cocos2d-x 3.0 创建工程的模板

将下面的代码拷贝到文本文件中,重命名文件为 cocos3.0创建工程.bat


@echo off
 
echo -------------------------create project with python----------------------------- 
 
set /p project_name= "Please enter your project name [for example: Runner] : "
 
echo --------your project name : %project_name%
 
set /p package_name= "Please enter your package name [for example: com.firedragonpzy.roy ] : "
 
echo --------your package name : %package_name%
 
set /p language_type= "Please enter your language types [cpp | javascript | lua] : "
 
echo --------your language types : %language_type%

set  directory_path=e:\cocoSample

echo --------your project directory : %directory_path%
 
set temp_path=\tools\cocos2d-console\bin
 
set project_path=%cd%%temp_path%
 
cd %project_path%
 
::E:\cocos2d-x-3.0\cocos2d-x-3.0\tools\cocos2d-console\bin\cocos.py 0.2 - cocos console: A command line tool for cocos2d
::Available commands:
::        compile      Compiles the current project to binary
::        new          Creates a new project
::        run          Compiles & deploy project and then runs it on the target
::        jscompile    minifies and/or compiles js files
::        deploy       Deploy a project to the target
::Example:
::        E:\cocos2d-x-3.0\cocos2d-x-3.0\tools\cocos2d-console\bin\cocos.py new --help
::        E:\cocos2d-x-3.0\cocos2d-x-3.0\tools\cocos2d-console\bin\cocos.py run --help

::E:\cocos2d-x-3.0\cocos2d-x-3.0\tools\cocos2d-console\bin>cocos.py new --help
:: usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY] [-t TEMPLATE_NAME] [--no-native] [PROJECT_NAME]
:: Creates a new project
:: positional arguments: PROJECT_NAME          Set the project name
:: optional arguments:
::  -h, --help            show this help message and exit
::  -p PACKAGE_NAME, --package PACKAGE_NAME
::                       Set a package name for project
::  -l {cpp,lua,js}, --language {cpp,lua,js}
::                        Major programming language you want to use, should be [cpp | lua | js]
::  -d DIRECTORY, --directory DIRECTORY
::                        Set generate project directory for project
::  -t TEMPLATE_NAME, --template TEMPLATE_NAME
::                        Set the template name you want create from
::lua/js project arguments:
::  --no-native           No native support.

set temp_path=\cocos.py new -p %package_name% -l %language_type% -d %directory_path% %project_name%
 
set last=%project_path%%temp_path%
 
%last%
 
pause

将这个bat文件放在工程的根目录中,同时修改
set  directory_path=e:\cocoSample

这一句中生成的工程路径为自己的工程路径


哈哈,以后就不用在输入繁琐的命令了大笑



转载于:https://www.cnblogs.com/shiweihappy/p/4246444.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值