要让cocos new 的时候不要copy库,需修改
templates/cpp-template-default/cocos-project-template.json
把do_default里的append_x_engine子项删除,其他子项命令为改项目名
/*
"append_x_engine":{
"from":".",
"to":"cocos2d"
},
*/
template/cocos2dx_files.json是要copy的文件,分common 和lua
代码跟踪
cocos new tools/cocos2d-console/bin/cocos.py
run_plugin plugin.run
new是在tools/cocos2d-console/plugins/project_new/project_new.py定义
run
_create_from_cmd()
TPCreator::__init__
self.tp_json = 'cocos-project-template.json’
do_default_step
self.cp_self(self.project_dir, exclude_files) copy template除了cocos-project-template.json
self.do_cmds(default_cmds) 执行cocos-project-template里的命令