Reputation: 115
In my podfile I am using a post install hook to add build phase scripts to the Pods project targets and build each of the targets. The problem I am having is I that am using
system "xcodebuild -target #{target.name} -sdk iphonesimulator"
which is building the current Pods project as I am in the Pods directory as opposed to the pods project being generated by the podfile and passed into the post install hook. So I'm wondering if anyone has come across a way or a ruby gem that allows building of a target in the post_install hook? Iv been trying for a few days and haven't found any workaround and the only solution I can find means running pod install twice, first to add the scripts and integrate the project and second to build the targets to run those scripts which is less than ideal.
post_install do | installer |
installer.project.targets do |target|
// adding build script to target
target.build() <-- this is what i need, some way to build this target.
end
end
Thanks.
Upvotes: 0
Views: 1938
Reputation: 115
Figured out a way to do this. Basically my issue was that i needed to be able to change the pods project post integration and run xcodebuild on it. However there is no post_integration hook in the podfile. What I did was created a setup.sh file which had two line
pod install
ruby myScript.sh
Then in myScript.sh I used xcodeproj to add the build phases, saved the project and then ran xcodebuild which was then building the targets with the correct run sctipts.
Upvotes: 1