cocos compile

转载 2015年07月10日 11:27:39

转自 : http://blog.csdn.net/wanglang3081/article/details/39692459

cocos compile

Overview

Build an existed project.

Usage

usage: cocos compile [-h] [-s SRC_DIR] [-q] [-p PLATFORM] [-m MODE] [-j JOBS]
                     [--ap ANDROID_PLATFORM] [--ndk-mode NDK_MODE]
                     [--source-map] [--sign-identity SIGN_ID] [--no-res]
                     [--compile-script {0,1}] [--lua-encrypt]
                     [--lua-encrypt-key LUA_ENCRYPT_KEY]
                     [--lua-encrypt-sign LUA_ENCRYPT_SIGN]

Available Arguments

Common Arguments

arg available value sample description necessary
-h, --help - - Show the help message and exit no
-s, --src project path ./projects/MyLuaGame Specify the project path. Default value is current directory. no
-p, --platform the target platform android Specify the target platform. yes
-m, --mode the compiling mode release Set the compile mode, should be debug or release. Default is debug. no
-j, --jobs number of jobs at once 4 Use N jobs at once. It's only take effect with target android & linux. no
-o, --output-dir absolute/relative path ./release/android Specify the output directory. no

Android Arguments

arg available value sample description necessary
--ap folder name inANDROID_SDK_ROOT/platforms android-16 Specify the API-Level of android sdk. Console will auto select it if not specified. no
--ndk-mode the compiling mode of ndk-build release Set the compile mode of ndk-build, should be one of {debug, release, none}, native code will not be compiled when the value is none. Default is same value with -m no

Web Arguments

arg available value sample description necessary
--source-map - - Enable source-map no
--advanced - - Set the compilationLevel value as advanced for js compiling. no

iOS/Mac Arguments

arg available value sample description necessary
-t, --target Target Name in XCode project MyGame iOS Specify the target name to compile. no

iOS Arguments

arg available value sample description necessary
--sign-identity the code sign identity "iPhone Distribution:xxxxxxxx" The code sign identity for iOS. It's required when the value of "-m, -mode" is release.

lua/js project Arguments

arg available value sample description necessary
--compile-script {0,1} 1 Disable/Enable the compiling of lua/js script files. If not specified, the value is 1 when -m, --mode isrelease. Otherwise, the value is 0 no

lua project Arguments

arg available value sample description necessary
--lua-encrypt - - Enable the encrypting of lua scripts. It's only take effect when --compile-script value is 1 no
--lua-encrypt-key any string MyLuaKey Specify the encrypt key for the encrypting of lua scripts. It's only take effect when --lua-encrypt is enabled. Default value is 2dxLua. no
--lua-encrypt-sign any string MyLuaSign Specify the encrypt sign for the encrypting of lua scripts. It's only take effect when --lua-encrypt is enabled. Default value is XXTEA. no

Attentions

  • You can see the valid target platforms without specify -p, --platform first. The available platforms will be shown like this:available platforms
  • --compile-script will not take effect when target is linux or web
  • If --lua-encrypt is enabled, you should modify the C++ code frameworks/runtime-src/Classes/AppDelegate.cpp like this:

    bool AppDelegate::applicationDidFinishLaunching()
    {
        ...
    
        auto engine = LuaEngine::getInstance();
        ScriptEngineManager::getInstance()->setScriptEngine(engine);
    
        // add these two lines 
        // "MyLuaKey" is the string specified by "--lua-encrypt-key"
        // "MyLuaSign" is the string specified by "--lua-encrypt-sign"
        LuaStack* stack = engine->getLuaStack();
        stack->setXXTEAKeyAndSign("MyLuaKey", strlen("MyLuaKey"), "MyLuaSign", strlen("MyLuaSign"));
    
        ...
    }
    

Samples

  • cocos compile -h. Show the help message.
  • cocos compile -s ./projects/MyLuaGame -p android --ndk-mode release --compile-script 1 --lua-encrypt
    Build MyLuaGame for android with ndk-build is release. And compile lua script files with encrypting.
  • cocos compile -s ./projects/MyLuaGame -p ios -m release --sign-identity "iPhone Distribution:xxxxxxxx"
    Build MyLuaGame for ios with release mode. Use the code sign identity "iPhone Distribution:xxxxxxxx".

how to compile and run cocos2dx in linux

I believe for android development, linux is much better than windows. Originally development in visu...

c interface source code with scons compile

  • 2015年03月31日 16:34
  • 317KB
  • 下载

angularJS 自定义指令 方法属性:compile、link

自定义指令还有compile属性,这个属性是一个function, 在其中可以更改dom元素,或者进行dom元素的事件绑定等。该function中可以返还一个function,返还的这个functio...

vlc compile for android

  • 2014年08月21日 15:12
  • 96KB
  • 下载

How to compile Amalgamation for android

  • 2017年07月21日 17:56
  • 64KB
  • 下载

Python可执行对象——exec、eval、compile

http://www.pythoner.com/56.html 这篇文章将对Python提供的调用可执行对象的内建函数进行说明,涉及exec、eval、compile三个函数。exec语句用...

vbox compile

  • 2015年01月13日 21:09
  • 9KB
  • 下载

libxml2-2.9.2_compile_20170118_1636.tar.gz

  • 2017年01月18日 17:03
  • 18.89MB
  • 下载

Maven项目构建命令compile、test、package

compile 前面我们按照maven约束好的文件路径建好项目后,加入pom.xml 在命令行输入mvn compile后,maven就会自动帮我们下载依赖jar,为代码生成字节码文件等。我们把...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:cocos compile
举报原因:
原因补充:

(最多只允许输入30个字)