Template repository for creating new SPM / Xcode build plugins project
Add this configuration to your Package.swift:
dependencies: [
.package(url: "https://github.com/MyGithubUser/MyPlugin", from: "0.1.0"),
],Then add the plugins to your target:
.target(
name: "MyProjectPackage",
plugins: [
.plugin(name: "MyPlugin", package: "MyPlugin")
]
)Integration into Xcode project:
- In Xcode root project, navigate to your targets list in side bar.
- Select target to integrate (usually app or library target).
- Go to Build Phase -> Run Build Tool Plug-ins -> Add the plugin
If you are building on CI server, you have to add this as the xcodebuild command arguments to bypass xcode validation:
-skipPackagePluginValidation
-skipMacroValidation
Or if you are building on Xcode Cloud, you can disable it by adding this to ci_scripts/ci_post_clone.sh:
defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES
defaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES