Xcodebuild for Package.swift dynamic framework not creating Swift module

I'm trying to build my SDK without an xcodeproj.

My xcodebuild command looks like this:

xcodebuild archive \
            -scheme MySDK \
            -configuration Release \
           -destination "generic/platform=iOS" \
           -derivedDataPath .build \
           -archivePath .build/MySDK.xcarchive \
           SKIP_INSTALL=NO \
           BUILD_LIBRARY_FOR_DISTRIBUTION=YES

The resultant framework (in MySDK.xcarcxhive/Products/usr/local/lib) is missing the Modules folder. Meanwhile the relevant swiftmodule info seems to be in here DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MySDK/BuildProductsPath/Release-iphonesimulator/MySDK.swiftmodule โ€“ but the structure is different than normal (ie. when I use an xcodeproj to build the xcframework) and there is no .modulemap to be seen.

My Package.swift: My Package.swift ยท GitHub

Can xcodebuild + Package.swift be used to create swift friendly XCFrameworks (for iOS)?? Seems odd it makes the swiftmodule stuff and then does nothing with it. Any help appreciated...Thx

1 Like

ok so there's a modulemap here (how could I have missed it :roll_eyes: ). BUT it doesn't have the module * {export * } line usually found. And I have a submodule in the packageswift I'm hoping to expose...hmm...

DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MySDK/IntermediateBuildFilesPath/MySDK.build/Release-iphonesimulator/MySDK.build/MySDK.modulemap