I am developing a server in Swift and using the Swift Package Manager. And find it convenient when doing my development on my Mac OS system to generate a Xcode project to use Xcode as my IDE (i.e., From time to time, my package dependencies have to be updated. I've been using swift package generate-xcodeproj
to do this. My problem comes in at this point-- I have created some settings in Xcode. E.g., I've set a DEBUG flag, and I have a .plist file that is in the Copy Files Phase. These get lost when I regenerate the Xcode project. It seems I cannot simply use swift package update
because sometimes files change in the dependencies and these don't get propagated to the Xcode project.
What I'd like is a means to separately establish Xcode settings in a file outside of Xcode, that can be imported into Xcode when I do the swift package generate-xcodeproj
. I have not seen a way to do this.
A related question is: When I do a swift build
I'd like those same build settings to be used.
Suggestions?
I would use a script or a makefile to import your settings into the generated Xcode project, each time you regenerate it. You can use xcodeproj rubygem.
See an example script.
Regarding using your settings in
swift build
, can you give an example of such a setting? In general, a makefile can read your settings file and pass the corresponding parameters toswift build
.