I have a Run Script phase in my Xcode project. After I update my dependencies with SPM via swift package update
I have to update my project with swift package generate-xcodeproj
.
Without using a rubygem, pod spec or other 3rd part tool, how Can I maintain that build phase? Can I add Run Script phase to xcconfig file somehow?
With SwiftPM currently, the xcode project file is generated from a template, and any extensions on it are considered to be ephemeral - the recreation of the xcode project file only looks at what's in Package.swift, and not any existing projects. The result is that any extensions you add in (like a shell script build phase) are always going to be lost when you regenerate the script.
I recommend wrapping the whole project in a Makefile or something equivalent if you need to invoke a shell script or equiv kind of mechanism for your build, rather than extending the generated xcode project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With