p = subprocess.Popen(['vagrant', '--version'],
stdout=subprocess.PIPE)
- vver = p.communicate()[0]
+ vver = p.communicate()[0].strip().split(' ')[1]
+ if vver.split('.')[0] != '1' or int(vver.split('.')[1]) < 4:
+ raise BuildException("Unsupported vagrant version {0}".format(vver))
+
with open(os.path.join('builder', 'Vagrantfile'), 'w') as vf:
- if vver.startswith('Vagrant version 1.2'):
- vf.write('Vagrant.configure("2") do |config|\n')
- vf.write('config.vm.box = "buildserver"\n')
- vf.write('end\n')
- else:
- vf.write('Vagrant::Config.run do |config|\n')
- vf.write('config.vm.box = "buildserver"\n')
- vf.write('end\n')
+ vf.write('Vagrant.configure("2") do |config|\n')
+ vf.write('config.vm.box = "buildserver"\n')
+ vf.write('config.vm.synced_folder ".", "/vagrant", disabled: true\n')
+ vf.write('end\n')
logging.info("Starting new build server")
retcode, _ = vagrant(['up'], cwd='builder')
if build.gradleprops:
cmd += ['-P'+kv for kv in build.gradleprops]
- for task in gradletasks:
- parts = task.split(':')
- parts[-1] = 'clean' + capitalize_intact(parts[-1])
- cmd += [':'.join(parts)]
-
cmd += ['clean']
p = FDroidPopen(cmd, cwd=root_dir)
os.path.join(root_dir, 'build', 'outputs', 'apk'),
os.path.join(root_dir, 'build', 'apk'),
]:
- apks = glob.glob(os.path.join(apks_dir, '*-release-unsigned.apk'))
-
- if len(apks) > 1:
- raise BuildException('More than one resulting apks found in %s' % apks_dir,
- '\n'.join(apks))
- if len(apks) == 1:
- src = apks[0]
+ for apkglob in ['*-release-unsigned.apk', '*-unsigned.apk', '*.apk']:
+ apks = glob.glob(os.path.join(apks_dir, apkglob))
+
+ if len(apks) > 1:
+ raise BuildException('More than one resulting apks found in %s' % apks_dir,
+ '\n'.join(apks))
+ if len(apks) == 1:
+ src = apks[0]
+ break
+ if src is not None:
break
if src is None:
global options, config
options, parser = parse_commandline()
+
+ metadata_files = glob.glob('.fdroid.*[a-z]') # ignore files ending in ~
+ if len(metadata_files) > 1:
+ raise FDroidException("Only one local metadata file allowed! Found: "
+ + " ".join(metadata_files))
+
+ if not os.path.isdir('metadata') and len(metadata_files) == 0:
+ raise FDroidException("No app metadata found, nothing to process!")
+
if not options.appid and not options.all:
parser.error("option %s: If you really want to build all the apps, use --all" % "all")