Skip to content

Commit 74f0ca3

Browse files
Merge branch 'v3' of github.com:kosmosR2/cocos2d-console into HEAD
2 parents e1b929f + 57848f9 commit 74f0ca3

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

bin/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
"COMPILE_INFO_BUILDING" : "Building...",
177177
"COMPILE_INFO_FIND_IN_REG_FMT" : "Finding VS in registry : %s",
178178
"COMPILE_INFO_REQUIRED_VS_FMT" : "Required VS version : %s",
179+
"COMPILE_INFO_USE_COCOAPODS" : "CocoaPods detected: use xcworkspace for build",
179180
"COMPILE_ERROR_WRONG_MODE_FMT" : "Value of '-m' should be one of %s.",
180181
"COMPILE_ERROR_WRONG_NDK_MODE_FMT" : "Value of '--ndk-mode' should be one of %s.",
181182
"COMPILE_ERROR_WRONG_VS_VER_FMT" : "VS %d is not supported.",
@@ -517,6 +518,7 @@
517518
"COMPILE_INFO_BUILDING" : "正在编译...",
518519
"COMPILE_INFO_FIND_IN_REG_FMT" : "在 %s 注册表中查找 VS 安装路径。",
519520
"COMPILE_INFO_REQUIRED_VS_FMT" : "要求的 VS 版本:%s",
521+
"COMPILE_INFO_USE_COCOAPODS" : "检测到 CocoaPods:使用 xcworkspace 进行编译。",
520522
"COMPILE_ERROR_WRONG_MODE_FMT" : "'-m' 参数取值范围:%s。",
521523
"COMPILE_ERROR_WRONG_NDK_MODE_FMT" : "'--ndk-mode' 参数取值范围:%s。",
522524
"COMPILE_ERROR_WRONG_VS_VER_FMT" : "不支持 VS %d。",
@@ -857,6 +859,7 @@
857859
"COMPILE_INFO_BUILDING" : "正在編譯...",
858860
"COMPILE_INFO_FIND_IN_REG_FMT" : "在 %s 註冊表中查找 VS 安裝路徑。",
859861
"COMPILE_INFO_REQUIRED_VS_FMT" : "要求的 VS 版本:%s",
862+
"COMPILE_INFO_USE_COCOAPODS" : "檢測到 CocoaPods:使用 xcworkspace 进行编译。",
860863
"COMPILE_ERROR_WRONG_MODE_FMT" : "'-m' 參數取值範圍:%s。",
861864
"COMPILE_ERROR_WRONG_NDK_MODE_FMT" : "'--ndk-mode' 參數取值範圍:%s。",
862865
"COMPILE_ERROR_WRONG_VS_VER_FMT" : "不支持 VS %d。",

plugins/plugin_compile/build_android.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,14 @@ def do_build_apk(self, build_mode, no_apk, output_dir, custom_step_args, compile
497497

498498
# only build 64bit
499499
if build_type == self.LuaBuildType.ONLY_BUILD_64BIT:
500-
dst_dir = os.path.join(assets_dir, 'src/64bit')
501-
compile_obj.compile_lua_scripts(src_dir, dst_dir, True)
502-
# remove unneeded lua files
503-
compile_obj._remove_file_with_ext(src_dir, '.lua')
504-
shutil.rmtree(os.path.join(src_dir, 'cocos'))
500+
if build_mode == 'release':
501+
dst_dir = os.path.join(assets_dir, 'src/64bit')
502+
compile_obj.compile_lua_scripts(src_dir, dst_dir, True)
503+
# remove unneeded lua files
504+
compile_obj._remove_file_with_ext(src_dir, '.lua')
505+
shutil.rmtree(os.path.join(src_dir, 'cocos'))
506+
else:
507+
compile_obj.compile_lua_scripts(src_dir, src_dir, False)
505508

506509
# only build 32bit
507510
if build_type == self.LuaBuildType.ONLY_BUILD_32BIT:

plugins/plugin_compile/project_compile.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,13 @@ def check_ios_mac_build_depends(self):
565565

566566
self.project_name = name
567567
self.xcodeproj_name = xcodeproj_name
568+
project_dir = self._platforms.project_path()
569+
podfile = os.path.join(project_dir, 'Podfile')
570+
self.xcworkspace = os.path.join(project_dir, name+'.xcworkspace')
571+
self.cocoapods = os.path.exists(self.xcworkspace) and os.path.exists(podfile)
572+
if self.cocoapods:
573+
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_USE_COCOAPODS'))
574+
568575

569576
def _remove_res(self, target_path):
570577
build_cfg_dir = self._build_cfg_path()
@@ -739,11 +746,11 @@ def build_ios(self):
739746

740747
command = ' '.join([
741748
"xcodebuild",
742-
"-project",
743-
"\"%s\"" % projectPath,
749+
"-workspace" if self.cocoapods else "-project",
750+
"\"%s\"" % self.xcworkspace if self.cocoapods else projectPath,
744751
"-configuration",
745752
"%s" % 'Debug' if self._mode == 'debug' else 'Release',
746-
"-target",
753+
"-scheme" if self.cocoapods else "-target",
747754
"\"%s\"" % targetName,
748755
"%s" % "-arch i386" if self.use_sdk == 'iphonesimulator' else '',
749756
"-sdk",
@@ -877,11 +884,11 @@ def build_mac(self):
877884

878885
command = ' '.join([
879886
"xcodebuild",
880-
"-project",
881-
"\"%s\"" % projectPath,
887+
"-workspace" if self.cocoapods else "-project",
888+
"\"%s\"" % self.xcworkspace if self.cocoapods else projectPath,
882889
"-configuration",
883890
"%s" % 'Debug' if self._mode == 'debug' else 'Release',
884-
"-target",
891+
"-scheme" if self.cocoapods else "-target",
885892
"\"%s\"" % targetName,
886893
"CONFIGURATION_BUILD_DIR=\"%s\"" % (output_dir)
887894
])
-3.5 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)