I have a situation where I need to enable ARC for many files in few Non-ARC xcode projects. I don't want complete conversion to ARC only few files needs to be enabled with arc.
There are many solutions that includes -fobjc-arc flag to specific files in the Compile Sources using the XCode console. But I have too many files in multiple xcode-projects to change it individually through XCode.
Is there a method by which I can modify the build phase settings programmatically. I found few posts like
- Tutorial or Guide for Scripting XCode Build Phases
- Per-file compiler flags in Xcode project template
Both of which are good solutions but I need to setup a mechanism where I can write scripts to manage them. As some of these run on servers and the resultant xcode is distributed to other people to test.
Manipulations of project.pbxproj code seems to be the most likely choice. But I am not sure how to go about it.