From 30113aa452a458d03e6c70e2c8092e62d85a5f0b Mon Sep 17 00:00:00 2001 From: agrieve Date: Thu, 30 Mar 2017 14:14:36 -0700 Subject: [PATCH] generate_gradle.py: Add --extra-target that appends to the default set I find this is more often what I want (as opposed to replacing the default list of targets). BUG=620034 Review-Url: https://codereview.chromium.org/2784293002 Cr-Original-Commit-Position: refs/heads/master@{#460878} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: f8d338ac684358b34a2cd77518d434fb6fa433a3 --- android/gradle/generate_gradle.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/android/gradle/generate_gradle.py b/android/gradle/generate_gradle.py index ec50a247b..88d02633a 100755 --- a/android/gradle/generate_gradle.py +++ b/android/gradle/generate_gradle.py @@ -633,8 +633,13 @@ def main(): parser.add_argument('--target', dest='targets', action='append', - help='GN target to generate project for. ' - 'May be repeated.') + help='GN target to generate project for. Replaces set of ' + 'default targets. May be repeated.') + parser.add_argument('--extra-target', + dest='extra_targets', + action='append', + help='GN target to generate project for, in addition to ' + 'the default ones. May be repeated.') parser.add_argument('--project-dir', help='Root of the output project.', default=os.path.join('$CHROMIUM_OUTPUT_DIR', 'gradle')) @@ -676,6 +681,8 @@ def main(): targets = _QueryForAllGnTargets(output_dir) else: targets = args.targets or _DEFAULT_TARGETS + if args.extra_targets: + targets.extend(args.extra_targets) targets = [re.sub(r'_test_apk$', '_test_apk__apk', t) for t in targets] # TODO(wnwen): Utilize Gradle's test constructs for our junit tests? targets = [re.sub(r'_junit_tests$', '_junit_tests__java_binary', t)