diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 76307f53..065ea324 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -29,6 +29,7 @@ import time import json from ConfigParser import ConfigParser from optparse import OptionParser, OptionError +from distutils.version import LooseVersion import logging import common @@ -707,7 +708,8 @@ def build_local(app, thisbuild, vcs, build_dir, output_dir, srclib_dir, extlib_d # Avoid having to use lintOptions.abortOnError false # TODO: Do flavours or project names change this task name? - commands += ['-x', 'lintVitalRelease'] + if thisbuild['gradlepluginver'] >= LooseVersion('0.8'): + commands += ['-x', 'lintVital' + flavours_cmd + 'Release'] p = FDroidPopen(commands, cwd=gradle_dir) diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 01da3168..fc31a8bd 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -30,6 +30,7 @@ import Queue import threading import magic import logging +from distutils.version import LooseVersion import metadata @@ -1129,6 +1130,27 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if flavour in ['main', 'yes', '']: flavour = None + version_regex = re.compile(r".*'com\.android\.tools\.build:gradle:([^\.]+\.[^\.]+).*'.*") + gradlepluginver = None + + with open(os.path.join(root_dir, 'build.gradle')) as f: + for line in f: + match = version_regex.match(line) + if match: + gradlepluginver = match.group(1) + break + if '@' in build['gradle'] and not gradlepluginver: + gradle_dir = os.path.join(root_dir, build['gradle'].split('@', 1)[1]) + gradle_dir = os.path.normpath(gradle_dir) + with open(os.path.join(root_dir, 'build.gradle')) as f: + for line in f: + match = version_regex.match(line) + if match: + gradlepluginver = match.group(1) + break + + build['gradlepluginver'] = LooseVersion(gradlepluginver) + if build['target']: n = build["target"].split('-')[1] FDroidPopen(['sed', '-i',