From: Daniel Martí Date: Sat, 13 Sep 2014 11:01:08 +0000 (+0200) Subject: Make gradle and antcommands (previously antcommand) proper lists X-Git-Tag: 0.3.0~63 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=a195556378390e94d51afea566385cf1b488e51e;p=fdroidserver.git Make gradle and antcommands (previously antcommand) proper lists --- diff --git a/docs/fdroid.texi b/docs/fdroid.texi index c85fad9c..232f0a01 100644 --- a/docs/fdroid.texi +++ b/docs/fdroid.texi @@ -1006,8 +1006,8 @@ builds happen correctly. Space-separated list of Gradle tasks to be run before the assemble task in a Gradle project build. -@item antcommand=xxx -Specify an alternate Ant command (target) instead of the default +@item antcommands=[,,...] +Specify an alternate set of Ant commands (target) instead of the default 'release'. It can't be given any flags, such as the path to a build.xml. @item output=path/to/output.apk diff --git a/fdroidserver/build.py b/fdroidserver/build.py index b38250e4..836835de 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -680,7 +680,7 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d elif thisbuild['type'] == 'gradle': logging.info("Building Gradle project...") - flavours = thisbuild['gradle'].split(',') + flavours = thisbuild['gradle'] if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']: flavours[0] = '' @@ -705,8 +705,8 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d elif thisbuild['type'] == 'ant': logging.info("Building Ant project...") cmd = ['ant'] - if thisbuild['antcommand']: - cmd += [thisbuild['antcommand']] + if thisbuild['antcommands']: + cmd += thisbuild['antcommands'] else: cmd += ['release'] p = FDroidPopen(cmd, cwd=root_dir) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index 4c1b5728..9bfd1151 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -352,18 +352,17 @@ def fetch_autoname(app, tag): except VCSException: return None - flavour = None + flavours = None if len(app['builds']) > 0: if app['builds'][-1]['subdir']: app_dir = os.path.join(app_dir, app['builds'][-1]['subdir']) if app['builds'][-1]['gradle']: - flavour = app['builds'][-1]['gradle'] - if flavour == 'yes': - flavour = None + flavours = app['builds'][-1]['gradle'] + if len(flavours) == 1 and flavours[0] in ['main', 'yes', '']: + flavours = None - logging.debug("...fetch auto name from " + app_dir + - ((" (flavour: %s)" % flavour) if flavour else "")) - new_name = common.fetch_real_name(app_dir, flavour) + logging.debug("...fetch auto name from " + app_dir) + new_name = common.fetch_real_name(app_dir, flavours) commitmsg = None if new_name: logging.debug("...got autoname '" + new_name + "'") @@ -375,7 +374,7 @@ def fetch_autoname(app, tag): logging.debug("...couldn't get autoname") if app['Current Version'].startswith('@string/'): - cv = common.version_name(app['Current Version'], app_dir, flavour) + cv = common.version_name(app['Current Version'], app_dir, flavours) if app['Current Version'] != cv: app['Current Version'] = cv if not commitmsg: diff --git a/fdroidserver/common.py b/fdroidserver/common.py index e884568a..6e6dfbc0 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -825,7 +825,7 @@ def retrieve_string(app_dir, string, xmlfiles=None): # Return list of existing files that will be used to find the highest vercode -def manifest_paths(app_dir, flavour): +def manifest_paths(app_dir, flavours): possible_manifests = \ [os.path.join(app_dir, 'AndroidManifest.xml'), @@ -833,19 +833,20 @@ def manifest_paths(app_dir, flavour): os.path.join(app_dir, 'src', 'AndroidManifest.xml'), os.path.join(app_dir, 'build.gradle')] - if flavour: - possible_manifests.append( - os.path.join(app_dir, 'src', flavour, 'AndroidManifest.xml')) + if flavours: + for flavour in flavours: + possible_manifests.append( + os.path.join(app_dir, 'src', flavour, 'AndroidManifest.xml')) return [path for path in possible_manifests if os.path.isfile(path)] # Retrieve the package name. Returns the name, or None if not found. -def fetch_real_name(app_dir, flavour): +def fetch_real_name(app_dir, flavours): app_search = re.compile(r'.*