Reputation: 39376
I've been using a Build Phase Run Script to execute a shell script that finds all the *.m files in my project directory, and passes them to genstrings, as a way of creating my localizable strings file.
find ${SOURCE_ROOT} -name "*.m" -print0 | xargs -0 genstrings -q -s NSLocalizedString -o ${lpath}
In a large project, I have a number of targets, and the app I am interested in localizing, doesn't utilize all the .m files that reside in the project directory. In fact, since some of the .m files are currently being phased out, there is definitely no need to be translating the strings in those files.
What I am looking for is a way to get a listing of all the *.m files that are set to be active for the current target. The same set of *.m files that Xcode will be compiling. I want a good way to only run genstrings on those files. Preferably I'd like this done as a separate build but it is ok if it executes this script/task during or after every build.
How should I do so?
Upvotes: 3
Views: 268