I have a game which has xml files in it. My game works on iPad and on iPhone, and i need to perform some changes in these xml files accordingly, but the xml files are original and i do not want them changed, so what i want is have my xml files changed automatically at compile time. For this purpose i have a ruby script which does what i need.
Let’s say this script is level_converter.rb
which i can execute(in terminal) as follows:
for f in Resources/*.xml; do ruby level_converter.rb "$f"; done
So i added this code to Build Phases to Run Script this way and this does work as expected, it does change all the xml files properly, BUT ofcourse it changes the original xml files in the resources foler. So say if i run twice – i’ll have these files changed twice. What i want is these files stay not changed but only those deployed should change. So i need some kind of $(PROJECT_DISTRIBUTION_AND_DEVELOPEMENT_TEMP_FOLDER) or something like that instead of simply Resorces/*.xml eg.
for f in $(PROJ_DISTRIB_AND_DEV_TMP_FLDE)/*.xml; do ruby level_converter.rb "$f"; done
edit: must be im not that clear with the question, so i’ve rephrased it
Regards,
Igor
i was able to achieve what i wanted, here is the script:
So i used this ${CODESIGNING_FOLDER_PATH} variable.
explanation:
this does what i wan’t but there are drawbacks/doubts:
edit: i moved the run script to be run before compiling source code, and didn’t get any warnings about signed resources changed since then. Wandering if that’s the cause