From e4f6dd396d84973c2a0f9527eb2610652524e9c3 Mon Sep 17 00:00:00 2001 From: Mezumona Kosaki Date: Wed, 27 May 2015 11:52:48 +0900 Subject: [PATCH] added argument "--ndk-toolchain-version" --- bin/strings.json | 2 ++ plugins/project_compile/build_android.py | 3 +++ plugins/project_compile/project_compile.py | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/bin/strings.json b/bin/strings.json index e7d6b59e..1515a144 100644 --- a/bin/strings.json +++ b/bin/strings.json @@ -131,6 +131,7 @@ "COMPILE_ARG_NDK_MODE" : "Set the compiling mode of ndk-build, should be debug|release|none, native code will not be compiled when the value is none. Default is same value with '-m'.", "COMPILE_ARG_APP_ABI" : "Set the APP_ABI of ndk-build.Can be multi value separated with ':'. Sample : --app-aib armeabi:x86:mips. Default value is 'armeabi'.", "COMPILE_ARG_TOOLCHAIN" : "Specify the NDK_TOOLCHAIN of ndk-build.", + "COMPILE_ARG_TOOLCHAIN_VERSION" : "Specify the NDK_TOOLCHAIN_VERSION of ndk-build.", "COMPILE_ARG_CPPFLAGS" : "Specify the APP_CPPFLAGS of ndk-build.", "COMPILE_ARG_STUDIO" : "Use the Android Studio project for Android platform.", "COMPILE_ARG_GROUP_WEB" : "Web Options", @@ -424,6 +425,7 @@ "COMPILE_ARG_NDK_MODE" : "设置 ndk-build 的模式,可选值为 debug|release|none,如果指定为 none,ndk-build 不会被调用。默认值与 '-m' 参数值相同。", "COMPILE_ARG_APP_ABI" : "设置 ndk-build 的 APP_ABI 属性。可以使用 ':' 分隔多个值。示例:--app-aib armeabi:x86:mips。默认值为 'armeabi'。", "COMPILE_ARG_TOOLCHAIN" : "指定 ndk-build 的 NDK_TOOLCHAIN 属性。", + "COMPILE_ARG_TOOLCHAIN_VERSION" : "指定 ndk-build 的 NDK_TOOLCHAIN_VERSION 属性。", "COMPILE_ARG_CPPFLAGS" : "指定 ndk-build 的 APP_CPPFLAGS 属性。", "COMPILE_ARG_STUDIO" : "使用 Android Studio 工程来编译 Android 平台。", "COMPILE_ARG_GROUP_WEB" : "Web 相关参数", diff --git a/plugins/project_compile/build_android.py b/plugins/project_compile/build_android.py index 6a9ba52f..071162b7 100755 --- a/plugins/project_compile/build_android.py +++ b/plugins/project_compile/build_android.py @@ -227,6 +227,9 @@ def get_toolchain_version(self, ndk_root, compile_obj): except: cocos.Logging.warning(MultiLanguage.get_string('COMPILE_WARNING_GET_NDK_VER_FAILED_FMT', version_file_path)) + if compile_obj.ndk_toolchain_version: + ret_version = compile_obj.ndk_toolchain_version + cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_NDK_TOOLCHAIN_VER_FMT', ret_version)) if ret_version == "4.8": compile_obj.add_warning_at_end(MultiLanguage.get_string('COMPILE_WARNING_TOOLCHAIN_FMT', ret_version)) diff --git a/plugins/project_compile/project_compile.py b/plugins/project_compile/project_compile.py index 75a313c8..6228d083 100644 --- a/plugins/project_compile/project_compile.py +++ b/plugins/project_compile/project_compile.py @@ -79,6 +79,8 @@ def _add_custom_options(self, parser): help=MultiLanguage.get_string('COMPILE_ARG_APP_ABI')) group.add_argument("--ndk-toolchain", dest="toolchain", help=MultiLanguage.get_string('COMPILE_ARG_TOOLCHAIN')) + group.add_argument("--ndk-toolchain-version", dest="toolchain_version", + help=MultiLanguage.get_string('COMPILE_ARG_TOOLCHAIN_VERSION')) group.add_argument("--ndk-cppflags", dest="cppflags", help=MultiLanguage.get_string('COMPILE_ARG_CPPFLAGS')) group.add_argument("--android-studio", dest="use_studio", action="store_true", @@ -145,6 +147,10 @@ def _check_custom_options(self, args): if args.toolchain: self.ndk_toolchain = args.toolchain + self.ndk_toolchain_version = None + if args.toolchain_version: + self.ndk_toolchain_version = args.toolchain_version + self.use_studio = args.use_studio # iOS/Mac arguments