-#!/usr/bin/env python2
-# -*- coding: utf-8 -*-
+#!/usr/bin/env python3
#
# build.py - part of the FDroid server tools
# Copyright (C) 2010-2014, Ciaran Gultnieks, ciaran@ciarang.com
cmd = [config['gradle']]
if build.gradleprops:
- cmd += ['-P'+kv for kv in build.gradleprops]
+ cmd += ['-P' + kv for kv in build.gradleprops]
cmd += ['clean']
# .gradle/ as binary files. To avoid overcomplicating the scanner,
# manually delete them, just like `gradle clean` should have removed
# the build/ dirs.
- del_dirs(['build', '.gradle', 'gradle'])
+ del_dirs(['build', '.gradle'])
del_files(['gradlew', 'gradlew.bat'])
if 'pom.xml' in files:
cmd = [config['gradle']]
if build.gradleprops:
- cmd += ['-P'+kv for kv in build.gradleprops]
+ cmd += ['-P' + kv for kv in build.gradleprops]
cmd += gradletasks
options, parser = parse_commandline()
metadata_files = glob.glob('.fdroid.*[a-z]') # ignore files ending in ~
- if len(metadata_files) > 1:
+ if os.path.isdir('metadata'):
+ pass
+ elif len(metadata_files) == 0:
+ raise FDroidException("No app metadata found, nothing to process!")
+ elif 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")