while chan.recv_stderr_ready():
error += chan.recv_stderr(1024)
if returncode != 0:
- raise BuildException("Build.py failed on server for %s:%s" % (app['id'], thisbuild['version']), output.strip(), error.strip())
+ raise BuildException("Build.py failed on server for %s:%s" % (app['id'], thisbuild['version']), output, error)
# Retrieve the built files...
print "Retrieving build output..."
ftp.get(apkfile, os.path.join(output_dir, apkfile))
ftp.get(tarball, os.path.join(output_dir, tarball))
except:
- 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, error)
ftp.close()
finally:
raise BuildException("NDK build failed for %s:%s" % (app['id'], thisbuild['version']))
p = None
- output = ""
- error = ""
+ if verbose:
+ output = None
+ error = None
+ else:
+ output = ''
+ error = ''
# Build the release...
if 'maven' in thisbuild:
print "Building Maven project..."
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- output += line
+ else:
+ output += line
for line in iter(p.stderr.readline, ''):
if verbose:
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- error += line
+ else:
+ error += line
elif 'gradle' in thisbuild:
print "Building Gradle project..."
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- output += line
+ else:
+ output += line
for line in iter(p.stderr.readline, ''):
if verbose:
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- error += line
+ else:
+ error += line
else:
print "Building Ant project..."
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- output += line
+ else:
+ output += line
for line in iter(p.stderr.readline, ''):
if verbose:
# Output directly to console
sys.stdout.write(line)
sys.stdout.flush()
- error += line
+ else:
+ error += line
p.communicate()
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, error)
if install:
if 'maven' in thisbuild:
p = subprocess.Popen([mvn3, 'android:deploy', '-Dandroid.sdk.path=' + sdk_path],
cwd=root_dir, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- output_, error = p.communicate()
+ output_, error_ = p.communicate()
if p.returncode != 0:
- raise BuildException("Warning: Could not deploy %s:%s" % (app['id'], thisbuild['version']), output_.strip(), error.strip())
+ raise BuildException("Warning: Could not deploy %s:%s" % (app['id'], thisbuild['version']), output_, error_)
return
print "Successfully built version " + thisbuild['version'] + ' of ' + app['id']
def __str__(self):
ret = repr(self.value)
if self.stdout:
- ret = ret + "\n==== stdout begin ====\n" + str(self.stdout) + "\n==== stdout end ===="
+ ret += "\n==== stdout begin ====\n%s\n==== stdout end ====" % self.stdout.strip()
if self.stderr:
- ret = ret + "\n==== stderr begin ====\n" + str(self.stderr) + "\n==== stderr end ===="
+ ret += "\n==== stderr begin ====\n%s\n==== stderr end ====" % self.stderr.strip()
return ret
class VCSException(Exception):
execfile('config.py', globals())
p = subprocess.Popen([os.path.join(sdk_path, 'build-tools', build_tools, 'aapt'),
- 'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
- stdout=subprocess.PIPE)
+ 'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
+ stdout=subprocess.PIPE)
output = p.communicate()[0]
if p.returncode != 0:
print "ERROR: Failed to get apk manifest information"