I've been trying to build SwiftPM package that I have through command line, but looks like the command line doesn't respect newly resources that was added in Swift 5.3. The sample project is a simple one, just included xcdatamodeld as
.process like below:
let package = Package( name: "CoreDataSwiftPM", platforms: [.iOS(.v14), .macOS(.v10_12)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( name: "CoreDataSwiftPM", targets: ["CoreDataSwiftPM"]), ], dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0"), ], targets: [ // Targets are the basic building blocks of a package. A target can define a module or a test suite. // Targets can depend on other targets in this package, and on products in packages this package depends on. .target( name: "CoreDataSwiftPM", dependencies: , resources: [ .process("Resources/Model.xcdatamodeld") ]), .testTarget( name: "CoreDataSwiftPMTests", dependencies: ["CoreDataSwiftPM"], resources: [ .process("Resources/Model.xcdatamodeld") ]), ] )
Using Xcode, everything works fine and I can see
momd file in my generated bundle, However, building it in command line with
swift bundle it just copies
xcdatamodeld file into the bundle without properly compiling it.
Is it an expected behavior? Any workaround for it?