diff --git a/scripts/build-windows.py b/scripts/build-windows.py index 1eb2265472198d2aca208c4f365a2fdcdf0aba95..7115590473060ff4962a6df5b030f68e654d2cd1 100644 --- a/scripts/build-windows.py +++ b/scripts/build-windows.py @@ -9,36 +9,31 @@ this_dir = os.path.dirname(os.path.realpath(__file__)) def execute_cmd(cmd, with_shell=False): p = subprocess.Popen(cmd, shell=with_shell) _, _ = p.communicate() + if p.returncode != 0: + sys.exit(1) return p.returncode def build_daemon(parsed_args): make_cmd = os.path.dirname(this_dir) + '\\daemon\\compat\\msvc\\winmake.py' os.chdir(os.path.dirname(this_dir) + '\\daemon\\compat\\msvc') - status_code = execute_cmd('python ' + make_cmd + ' -iv -t ' + - parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -b daemon') + execute_cmd('python ' + make_cmd + ' -iv -t ' + + parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -b daemon') os.chdir(os.path.dirname(this_dir)) - return status_code def build_lrc(parsed_args): make_cmd = os.path.dirname(this_dir) + '\\lrc\\make-lrc.py' - return execute_cmd('python ' + make_cmd + ' -gb ' + ' -t ' + parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -q ' + parsed_args.qtver) + execute_cmd('python ' + make_cmd + ' -gb ' + ' -t ' + parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -q ' + parsed_args.qtver) def build_client(parsed_args): os.chdir('./client-qt') - ret = 0 - ret &= not execute_cmd( - 'pandoc -f markdown -t html5 -o changelog.html changelog.md', True) - ret &= not execute_cmd('python make-client.py -d') - ret &= not execute_cmd('python make-client.py -b ' + '-t ' + - parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -q ' + parsed_args.qtver) - - if not os.path.exists('./x64/Release/qt.conf'): - ret &= not execute_cmd( - 'powershell -ExecutionPolicy Unrestricted -File copy-runtime-files.ps1' + ' "Release" ' + '"' + parsed_args.qtver + '"', True) - return ret + execute_cmd('pandoc -f markdown -t html5 -o changelog.html changelog.md', True) + execute_cmd('python make-client.py -d') + execute_cmd('python make-client.py -b ' + '-t ' + + parsed_args.toolset + ' -s ' + parsed_args.sdk + ' -q ' + parsed_args.qtver) + execute_cmd('powershell -ExecutionPolicy Unrestricted -File copy-runtime-files.ps1' + ' "Release" ' + '"' + parsed_args.qtver + '"', True) def parse_args(): @@ -57,20 +52,10 @@ def parse_args(): def main(): - parsed_args = parse_args() - - if build_daemon(parsed_args) != 0: - print('daemon build failure!') - sys.exit(1) - - if build_lrc(parsed_args) != 0: - print('lrc build failure!') - sys.exit(1) - - if build_client(parsed_args) != 0: - print('client build failure!') - sys.exit(1) + build_daemon(parsed_args) + build_lrc(parsed_args) + build_client(parsed_args) if __name__ == "__main__":