In this weekend, I successfully used python to deal with .xcodeproj folder, change a existing project into a new one.
The source code is here https://github.com/walzer/cocos2d-x/tree/create-hybrid-project/template-hybrid
Create a new project with extensions & chipmunk:
./create-project.py ~~project MyGame~~package com.MyCompany.AwesomeGame ~~modules extensions chipmunk
Create a new project using lua script:
bq. ./create-project.py~~project HelloWorld ~~package com.PSY.GangnamStyle~~language lua
The design is :
2. This script create-project.py will copy HelloLanguage to cocos2d-x/project// folder, rename HelloLanguage to
3. create-project.py will call template-hybrid/script_/process_proj.py, e.g. script_ios/process_proj.py
4. process_proj.py in each platform will deal with files in cocos2d-x/project//proj., rename files, replace strings and, remove useless modules.
Comoon design is to add modules into a existing project file, such as Titanium and Cordova do. But my design is firstly we have a big-fat-all-involved project, then remove useless modules from it. Deleting texts via regex is easier than adding texts to specified lines.
I would like to invite your suggestion on this case. This feature #1488 is still on early stage.