Skip to content

Commit 38bce0d

Browse files
committed
🎨clang工具 - 去掉UseNewBuildSystem参数;命令失败抛异常
1 parent ba51d95 commit 38bce0d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

client/tool/clang.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from tool.util.compile import BasicCompile
1919
from tool.util.xcodeswitch import XcodeSwitch
2020
from util.errcode import E_NODE_TASK_CONFIG
21-
from util.exceptions import TaskError
21+
from util.exceptions import TaskError, CompileTaskError
2222
from util.logutil import LogPrinter
2323
from util.subprocc import SubProcController
2424

@@ -62,16 +62,12 @@ def analyze(self, params):
6262
if not build_args:
6363
build_args = ['xcodebuild']
6464

65-
build_args.extend(['-UseNewBuildSystem=NO'])
66-
6765
# get compild cwd from env var
6866
build_cwd = os.environ.get('BUILD_CWD', None)
6967
compile_cwd = os.path.join(source_dir, build_cwd) if build_cwd else source_dir
7068

7169
# 执行前置命令
7270
if pre_cmd:
73-
if 'xcodebuild' in pre_cmd:
74-
pre_cmd = '%s -UseNewBuildSystem=NO' % pre_cmd # pre_cmd也不使用新的xcode构建系统,与编译命令保持一致
7571
LogPrinter.info('run pre command ...')
7672
pre_cmd = BasicCompile.generate_shell_file(pre_cmd, shell_name="tca_pre_cmd")
7773
LogPrinter.info('run pre cmd shell file: %s' % pre_cmd)
@@ -86,6 +82,7 @@ def analyze(self, params):
8682
sp.wait()
8783
if sp.returncode != 0:
8884
LogPrinter.info("Pre command run error!")
85+
raise CompileTaskError(msg=f"前置命令执行失败,请确认命令能否在代码根目录下成功执行: {pre_cmd}")
8986

9087
# 执行xcodebuild analyze
9188
LogPrinter.info('analyze project ...')
@@ -104,6 +101,7 @@ def analyze(self, params):
104101
sp.wait()
105102
if sp.returncode != 0:
106103
LogPrinter.info("Analyze Failed!")
104+
raise CompileTaskError(msg=f"编译命令执行失败,请确认编译命令能否在代码根目录下成功执行: {' '.join(build_cmd)}")
107105

108106
plist_paths = PlistParser().collect_plist_paths(build_log)
109107

0 commit comments

Comments
 (0)