1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Fix ant builds with recent output changes

This commit is contained in:
Daniel Martí 2013-09-02 23:14:12 +02:00
parent d59c0f64f9
commit 438c2dfa85

View File

@ -440,7 +440,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
if 'mvnflags' in thisbuild: if 'mvnflags' in thisbuild:
mvncmd += thisbuild['mvnflags'] 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(): for line in p.stdout.readlines():
if verbose: if verbose:
# Output directly to console # Output directly to console
@ -490,7 +490,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
if verbose: if verbose:
print "Running %s on %s" % (" ".join(commands), gradle_dir) 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(): for line in p.stdout.readlines():
if verbose: if verbose:
# Output directly to console # Output directly to console
@ -500,14 +500,20 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d
else: else:
print "Building Ant project..." print "Building Ant project..."
antcommands = ['ant']
if install: if install:
antcommands = ['debug','install'] antcommands += ['debug','install']
elif 'antcommand' in thisbuild: elif 'antcommand' in thisbuild:
antcommands = [thisbuild['antcommand']] antcommands += [thisbuild['antcommand']]
else: else:
antcommands = ['release'] antcommands += ['release']
p = subprocess.Popen(['ant'] + antcommands, cwd=root_dir, p = subprocess.Popen(antcommands, cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout=subprocess.PIPE, stderr=subprocess.PIPE) for line in p.stdout.readlines():
if verbose:
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
output += line
_, error = p.communicate() _, error = p.communicate()
if p.returncode != 0: if p.returncode != 0:
raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip()) raise BuildException("Build failed for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())