From 753e9c8175550298a10442c15108e0d65ad50d26 Mon Sep 17 00:00:00 2001 From: Marcus Hoffmann Date: Wed, 25 Jul 2018 18:59:22 +0200 Subject: [PATCH] scanner: properly combine all gradle compile commands with flavors --- fdroidserver/scanner.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index 739c7ba3..dc34d494 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -21,6 +21,7 @@ import re import traceback from argparse import ArgumentParser import logging +import itertools from . import _ from . import common @@ -38,19 +39,14 @@ def get_gradle_compile_commands(build): 'implementation', 'api', 'compileOnly', - 'runtimeOnly', - 'releaseCompile', - 'releaseProvided', - 'releaseApk', - 'releaseImplementation', - 'releaseApi', - 'releaseCompileOnly', - 'releaseRuntimeOnly'] + 'runtimeOnly'] + buildTypes = ['', 'release'] + flavors = [''] if build.gradle and build.gradle != ['yes']: - compileCommands += [flavor + 'Compile' for flavor in build.gradle] - compileCommands += [flavor + 'ReleaseCompile' for flavor in build.gradle] + flavors += build.gradle - return [re.compile(r'\s*' + c, re.IGNORECASE) for c in compileCommands] + commands = [''.join(c) for c in itertools.product(flavors, buildTypes, compileCommands)] + return [re.compile(r'\s*' + c, re.IGNORECASE) for c in commands] def scan_source(build_dir, build=metadata.Build()):