Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maintain Xcode Run Script Phase after swift package generate-xcodeproj

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?

like image 886
joels Avatar asked Apr 21 '17 16:04

joels


1 Answers

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.

like image 186
heckj Avatar answered Nov 18 '22 04:11

heckj