Frage

Is it possible to execute a script within a custom Xcode 4 project file template? I am not referring to a Run Script within the target build phase but a script that is executed once the template is chosen and prepares the project itself.

I am trying to create a template that forces the addition of a (number of) git submodules. To do so, I envisioned to run a script that is executed once the user creates a project file from my custom template. So far, my research did not succeed in finding a way to run a script once the template is used.

War es hilfreich?

Lösung

You could try adding a .gitmodules to a project template… no idea if that would fly under Xcode's templates.

If that fails, then, no -- but you can just add the .gitmodules file to the directory (or write a script), and the process should be quick and painless despite no direct support from the ide.

You might even take a middle of the road approach, where the project contained a script (PROJECT_ROOT/config_modules.sh) to add these modules to the repo at that directory. Then create another script to search, exec, and delete the config_modules.sh, once you have created all those projects.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top