Skip to content

Commit 94836bf

Browse files
committed
Add xcpretty support if installed in path.
1 parent be4cc39 commit 94836bf

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
@@ -549,6 +549,15 @@ def check_ios_mac_build_depends(self):
549549
self.project_name = name
550550
self.xcodeproj_name = xcodeproj_name
551551

552+
def append_xcpretty_if_installed(self, command):
553+
if not cocos.os_is_mac():
554+
return command;
555+
from distutils import spawn
556+
if spawn.find_executable("xcpretty") == None:
557+
return command
558+
return command + " | xcpretty"
559+
560+
552561
def _remove_res(self, target_path):
553562
build_cfg_dir = self._build_cfg_path()
554563
cfg_file = os.path.join(build_cfg_dir, CCPluginCompile.BUILD_CONFIG_FILE)
@@ -735,6 +744,7 @@ def build_ios(self):
735744
if self._sign_id is not None:
736745
command = "%s CODE_SIGN_IDENTITY=\"%s\"" % (command, self._sign_id)
737746

747+
command = self.append_xcpretty_if_installed(command)
738748
self._run_cmd(command)
739749

740750
filelist = os.listdir(output_dir)
@@ -865,6 +875,7 @@ def build_mac(self):
865875
"CONFIGURATION_BUILD_DIR=\"%s\"" % (output_dir)
866876
])
867877

878+
command = self.append_xcpretty_if_installed(command)
868879
self._run_cmd(command)
869880

870881
self.target_name = targetName

0 commit comments

Comments
 (0)