From 35137bbe429e9e960949bea360ea8ced926881f9 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Fri, 20 Jan 2017 14:32:15 -0600 Subject: [PATCH] Fixing printing for build step --- tools/export/gnuarmeclipse/__init__.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tools/export/gnuarmeclipse/__init__.py b/tools/export/gnuarmeclipse/__init__.py index 1b5668ef41..00f9ef4b4c 100644 --- a/tools/export/gnuarmeclipse/__init__.py +++ b/tools/export/gnuarmeclipse/__init__.py @@ -195,7 +195,7 @@ class GNUARMEclipse(Exporter): # override @staticmethod - def build(project_name, log_name="build_log.txt", cleanup=False): + def build(project_name, log_name="build_log.txt", cleanup=True): """ Headless build an Eclipse project. @@ -239,22 +239,24 @@ class GNUARMEclipse(Exporter): out, err = p.communicate() ret_code = p.returncode - out_string = "=" * 10 + "STDOUT" + "=" * 10 + "\n" - out_string += "See the build log for STDOUT" - out_string += "=" * 10 + "STDERR" + "=" * 10 + "\n" - out_string += err + stdout_string = "=" * 10 + "STDOUT" + "=" * 10 + "\n" + err_string = "=" * 10 + "STDERR" + "=" * 10 + "\n" + err_string += err - if ret_code == 0: - out_string += "SUCCESS" - else: - out_string += "FAILURE" - print out_string + ret_string = "SUCCESS\n" + if ret_code != 0: + ret_string += "FAILURE\n" + + print "%s\nSee %s for STDOUT\n%s\n%s" % (stdout_string, log_name, err_string, ret_string) if log_name: # Write the output to the log file with open(log_name, 'w+') as f: - f.write(out_string) + f.write(stdout_string) + f.write(out) + f.write(err_string) + f.write(ret_string) # Cleanup the exported and built files if cleanup: