Bug 1509572 - Part 4: Make `geckoview:generateSDKBindings` work without arguments. r=snorp
authorNick Alexander <nalexander@mozilla.com>
Mon, 26 Nov 2018 21:43:30 +0000
changeset 504570 851fd4b655df0e1e3cadc98b6930d6b8c7500f4a
parent 504569 a748fb34ae074dceab0824fe3b633ec753de2e4a
child 504571 d8102b5a209ab02d281b87e351a568be934c7ee6
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1509572
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509572 - Part 4: Make `geckoview:generateSDKBindings` work without arguments. r=snorp I'm not sure how this ever worked in the `android-gradle-dependencies` task -- it must have been because of `--continue`. Differential Revision: https://phabricator.services.mozilla.com/D12793
mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/SDKProcessor.java
mobile/android/geckoview/build.gradle
--- a/mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/SDKProcessor.java
+++ b/mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/SDKProcessor.java
@@ -221,18 +221,18 @@ public class SDKProcessor {
                 }
             }
             return new AnnotationInfo(stubName, mode, thread, target, noLiteral);
         }
     }
 
     public static void main(String[] args) throws Exception {
         // We expect a list of jars on the commandline. If missing, whinge about it.
-        if (args.length < 5 || args.length % 2 != 1) {
-            System.err.println("Usage: java SDKProcessor sdkjar max-sdk-version outdir [configfile fileprefix]+");
+        if (args.length < 3 || args.length % 2 != 1) {
+            System.err.println("Usage: java SDKProcessor sdkjar max-sdk-version outdir [configfile fileprefix]*");
             System.exit(1);
         }
 
         System.out.println("Processing platform bindings...");
 
         final String sdkJar = args[0];
         sMaxSdkVersion = Integer.parseInt(args[1]);
         final String outdir = args[2];
--- a/mobile/android/geckoview/build.gradle
+++ b/mobile/android/geckoview/build.gradle
@@ -375,18 +375,21 @@ task("generateSDKBindings", type: JavaEx
 
     main = 'org.mozilla.gecko.annotationProcessors.SDKProcessor'
     args android.bootClasspath
     args 16
     args "${topobjdir}/widget/android/bindings"
 
     // Configure the arguments at evaluation-time, not at configuration-time.
     doFirst {
-        // From -Pgenerate_sdk_bindings_args=... on command line.
-        args project.generate_sdk_bindings_args.split(':')
+        // From -Pgenerate_sdk_bindings_args=... on command line; missing in
+        // `android-gradle-dependencies` toolchain task.
+        if (project.hasProperty('generate_sdk_bindings_args')) {
+            args project.generate_sdk_bindings_args.split(':')
+        }
     }
 
     workingDir "${topsrcdir}/widget/android/bindings"
 
     dependsOn project(':annotations').jar
 }
 
 apply from: "${topsrcdir}/mobile/android/gradle/jacoco_dependencies.gradle"