Automating Xcode 4 Template Generation
Hello again!,It’s a nice day in the French Riviera ( or Côte d’azur )!, it’s been more work than pleasure here, but I guess life is good
In this iDevBlogADay post I will describe how we managed to automate our needs for Xcode 4 template generation. We wanted to automate it because we use a little Engine here at Gando Games (GG), and project templates where more or less a must for us. I have been reading everywhere about project templates in Xcode 4, and I must admit that it’s a rather obscure process. In order to understand a bit more, I followed the Boreal’s Kiss “A minimal project template for Xcode 4” article. After reading it, I realized that since our toolset was changing quite often, we where going to need to somehow automate the generation of Xcode 4 Templates for our internal engine, plus I thought it was a cool thing to do
That lead me to extend a very basic Cocos2d tool called Template Generator. This tool is just a simple python script which can build a very basic TemplateInfo.plist, which is basically a .plist file used to describe an Xcode 4 Template, this was great but wasn’t enough for my needs. After having found that tool, I contacted Ricardo Quesada (Cocos2d Lead Developer) and asked him if I could just take that tool and start a new “mini project” from there, he was very cool about it so I started hacking the script right away.
The results can be found in Github under the MIT license under the name of “Xcode 4 Template Generator“, I think the short description is self explanatory:
The Xcode 4 template generator, is a simple script written in Python to aid in the rather obscure process of creating Xcode 4 templates. As you may already be aware, Xcode 4 templates are very different from Xcode 3 templates, so taking a look at Boreal’s Kiss “A minimal project template for Xcode 4” is recommended. In that article you will find a lot of information about what is currently known about the new Template System.
I thought about this tool as a helper script for a meta script ran my Continuous Integration server, this meta script is the one in charge of actually building the full Xcode 4 template, I present you that script here:
WARNING: My Python is really noobish, sorry for that…
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|
So, that’s basically it more or less. I hope that from that script you’re able to extrapolate what you need in order to automate your Xcode 4 Template generation. As a last thing to say, the Xcode 4 Template Generator is far from complete, and should have issues… if you happen to need a patch feel free to open an issue in Github… or you want to collaborate I will totally welcome any kind of help, pull requests etc.
Until the next one!





Kas August 26th
Thank u so much 4 this python tool ^^
btw, could u tell me more about ‘how to use’ on OS X ?
this is python script, so dont know how to use this with some options.
simply, there is Xcode template project on Desktop, named ‘HoHo’.
then how to make plist by this tool ?
could u tell me more ^^;;;
thanks in advance !
Kas August 26th
oh got it ^^ thank u !
Nicolas Goles August 26th
Kas it’s good to hear that it worked for you
, it’s not REALLY 100% automated, but with a little work (like my “meta” python script example) you can get it to work.
There’s also some information in the Wiki of the Github webpage of the project.
Cheers!
Add Yours
YOU