Skip to content

Commit 8d30a6f

Browse files
author
Bin Zhang
authored
Merge pull request #318 from xpol/add-xcpretty-support
Add xcpretty support if installed in path.
2 parents ded2387 + 94836bf commit 8d30a6f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

plugins/plugin_compile/project_compile.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,15 @@ def check_ios_mac_build_depends(self):
573573
cocos.Logging.info(MultiLanguage.get_string('COMPILE_INFO_USE_COCOAPODS'))
574574

575575

576+
def append_xcpretty_if_installed(self, command):
577+
if not cocos.os_is_mac():
578+
return command;
579+
from distutils import spawn
580+
if spawn.find_executable("xcpretty") == None:
581+
return command
582+
return command + " | xcpretty"
583+
584+
576585
def _remove_res(self, target_path):
577586
build_cfg_dir = self._build_cfg_path()
578587
cfg_file = os.path.join(build_cfg_dir, CCPluginCompile.BUILD_CONFIG_FILE)
@@ -762,6 +771,7 @@ def build_ios(self):
762771
if self._sign_id is not None:
763772
command = "%s CODE_SIGN_IDENTITY=\"%s\"" % (command, self._sign_id)
764773

774+
command = self.append_xcpretty_if_installed(command)
765775
self._run_cmd(command)
766776

767777
filelist = os.listdir(output_dir)
@@ -893,6 +903,7 @@ def build_mac(self):
893903
"CONFIGURATION_BUILD_DIR=\"%s\"" % (output_dir)
894904
])
895905

906+
command = self.append_xcpretty_if_installed(command)
896907
self._run_cmd(command)
897908

898909
self.target_name = targetName

0 commit comments

Comments
 (0)