Support build action by adding the --action option in the command.
#2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sometimes we want to use
xcodebuild build ...insteadxcodebuild archive ..., because artifacts generated byxcodebuild build ...contain more debug information. For example:.swiftsourcefilewill only be generated when invoked by thexcodebuild build ...command.The xcframework of Alamofire generated by the
swift-create-xcframework --platform ios --action build --xc-setting OTHER_SWIFT_FLAGS="-debug-prefix-map $PWD=." Alamofirecommand are as below:Alamofire.xcframework ├── Info.plist ├── ios-arm64 │ ├── Alamofire.framework │ │ ├── Alamofire │ │ ├── Headers │ │ │ └── Alamofire-Swift.h │ │ ├── Info.plist │ │ └── Modules │ │ └── Alamofire.swiftmodule │ │ ├── Project │ │ │ └── arm64-apple-ios.swiftsourceinfo <============= Look here!!! │ │ ├── arm64-apple-ios.abi.json │ │ ├── arm64-apple-ios.private.swiftinterface │ │ ├── arm64-apple-ios.swiftdoc │ │ └── arm64-apple-ios.swiftinterface │ └── dSYMs │ └── Alamofire.framework.dSYM │ └── Contents │ ├── Info.plist │ └── Resources │ ├── DWARF │ └── Relocations └── ios-arm64_x86_64-simulator ├── Alamofire.framework │ ├── Alamofire │ ├── Headers │ │ └── Alamofire-Swift.h │ ├── Info.plist │ ├── Modules │ │ └── Alamofire.swiftmodule │ │ ├── Project │ │ │ ├── arm64-apple-ios-simulator.swiftsourceinfo │ │ │ └── x86_64-apple-ios-simulator.swiftsourceinfo │ │ ├── arm64-apple-ios-simulator.abi.json │ │ ├── arm64-apple-ios-simulator.private.swiftinterface │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ ├── arm64-apple-ios-simulator.swiftinterface │ │ ├── x86_64-apple-ios-simulator.abi.json │ │ ├── x86_64-apple-ios-simulator.private.swiftinterface │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ └── x86_64-apple-ios-simulator.swiftinterface │ └── _CodeSignature │ └── CodeResources └── dSYMs └── Alamofire.framework.dSYM └── Contents ├── Info.plist └── Resources ├── DWARF └── Relocations 26 directories, 25 filesOutput of
swift-create-xcframework --platform ios --action archive --xc-setting OTHER_SWIFT_FLAGS="-debug-prefix-map $PWD=." Alamofirecommand are as below(no.swiftsourceinfofile):Alamofire.xcframework ├── Info.plist ├── ios-arm64 │ ├── Alamofire.framework │ │ ├── Alamofire │ │ ├── Headers │ │ │ └── Alamofire-Swift.h │ │ ├── Info.plist │ │ └── Modules │ │ └── Alamofire.swiftmodule │ │ ├── arm64-apple-ios.abi.json │ │ ├── arm64-apple-ios.private.swiftinterface │ │ ├── arm64-apple-ios.swiftdoc │ │ └── arm64-apple-ios.swiftinterface │ └── dSYMs │ └── Alamofire.framework.dSYM │ └── Contents │ ├── Info.plist │ └── Resources │ ├── DWARF │ └── Relocations └── ios-arm64_x86_64-simulator ├── Alamofire.framework │ ├── Alamofire │ ├── Headers │ │ └── Alamofire-Swift.h │ ├── Info.plist │ ├── Modules │ │ └── Alamofire.swiftmodule │ │ ├── arm64-apple-ios-simulator.abi.json │ │ ├── arm64-apple-ios-simulator.private.swiftinterface │ │ ├── arm64-apple-ios-simulator.swiftdoc │ │ ├── arm64-apple-ios-simulator.swiftinterface │ │ ├── x86_64-apple-ios-simulator.abi.json │ │ ├── x86_64-apple-ios-simulator.private.swiftinterface │ │ ├── x86_64-apple-ios-simulator.swiftdoc │ │ └── x86_64-apple-ios-simulator.swiftinterface │ └── _CodeSignature │ └── CodeResources └── dSYMs └── Alamofire.framework.dSYM └── Contents ├── Info.plist └── Resources ├── DWARF └── Relocations 24 directories, 22 filesThe
.swiftsourceinfofile can be used to jump to the definition in the source code. Our team usually compiles third-party modules from source code to XCFramework to reduce compile time, and we also want to retain the ability to jump source code by clicking a property or class. Therefore we implemented--actionoption to configure the action used byxcodebuildinsideswift-create-xcframework