From 438c2dfa852f11f68b4c017fe9c3f0603caa9611 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Mon, 2 Sep 2013 23:14:12 +0200 Subject: [PATCH] Fix ant builds with recent output changes --- fdroidserver/build.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index d1b6039d..677579ff 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -440,7 +440,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d if 'mvnflags' in thisbuild: mvncmd += thisbuild['mvnflags'] - p = subprocess.Popen(mvncmd, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p = subprocess.Popen(mvncmd, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in p.stdout.readlines(): if verbose: # Output directly to console @@ -490,7 +490,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d if verbose: print "Running %s on %s" % (" ".join(commands), gradle_dir) - p = subprocess.Popen(commands, cwd=gradle_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + p = subprocess.Popen(commands, cwd=gradle_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in p.stdout.readlines(): if verbose: # Output directly to console @@ -500,14 +500,20 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d else: print "Building Ant project..." + antcommands = ['ant'] if install: - antcommands = ['debug','install'] + antcommands += ['debug','install'] elif 'antcommand' in thisbuild: - antcommands = [thisbuild['antcommand']] + antcommands += [thisbuild['antcommand']] else: - antcommands = ['release'] - p = subprocess.Popen(['ant'] + antcommands, cwd=root_dir, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + antcommands += ['release'] + p = subprocess.Popen(antcommands, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + for line in p.stdout.readlines(): + if verbose: + # Output directly to console + sys.stdout.write(line) + sys.stdout.flush() + output += line _, error = p.communicate() if p.returncode != 0: raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip()) -- 2.30.2