Commit Graph

12 Commits

Author SHA1 Message Date
Nick Alexander
b525daac01 Bug 1540820 - Don't write generated JNI wrappers for every Java-level change. r=agi
This was fallout from Bug 1509572, which moved the "invalidation
smarts" to Gradle. Unfortunately, those smarts are not smart enough:
there are many situations where the annotations might change (a new
method) but where they don't actually change (a new method that isn't
annotated with @JNITarget).

Since we don't want to spend the time to make the "invalidation
smarts" truly smart, we need to bring back this little bit of Bug
1509572.

While we're here, we ensure that there is only one JNI wrapper
generation task for GeckoView and Fennec, regardless of variant.
Right now, those are named like:

- geckoview:generateJNIWrappersForGeneratedWithGeckoBinariesDebug
- app:generateJNIWrappersForFennecWithoutGeckoBinariesDebug

See https://bugzilla.mozilla.org/show_bug.cgi?id=1509539#c1 for some
discussion of these JNI wrapper generation tasks.

Differential Revision: https://phabricator.services.mozilla.com/D26427

--HG--
extra : moz-landing-system : lando
2019-04-09 20:02:44 +00:00
Agi Sferro
95c7276481 Bug 1513395 - Upgrade com.android.tools to 26.2.1. r=snorp,geckoview-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D14514

--HG--
extra : moz-landing-system : lando
2018-12-14 21:33:05 +00:00
Nick Alexander
7fb85f7972 Bug 1509572 - Part 6: Don't always generate annotations from Gradle. r=snorp
Before, we always ran the "generate JNI wrappers" command and had the
command be smart about updating the output.  Now we move the smarts to
the Gradle side to streamline the build.

Differential Revision: https://phabricator.services.mozilla.com/D12795

--HG--
extra : moz-landing-system : lando
2018-11-26 21:44:00 +00:00
Nick Alexander
989700629b 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

--HG--
extra : moz-landing-system : lando
2018-11-26 21:43:30 +00:00
Dorel Luca
508e50ac02 Backed out 6 changesets (bug 1509572) for linting failure. CLOSED TREE
Backed out changeset 9f6a7e664cef (bug 1509572)
Backed out changeset f6653c7d2967 (bug 1509572)
Backed out changeset 122d6f1a1136 (bug 1509572)
Backed out changeset bc6911d14ae0 (bug 1509572)
Backed out changeset bd0729ff0bbc (bug 1509572)
Backed out changeset c4087e8ea340 (bug 1509572)
2018-11-26 23:21:28 +02:00
Nick Alexander
08717a6883 Bug 1509572 - Part 6: Don't always generate annotations from Gradle. r=snorp
Before, we always ran the "generate JNI wrappers" command and had the
command be smart about updating the output.  Now we move the smarts to
the Gradle side to streamline the build.

Depends on D12794

Differential Revision: https://phabricator.services.mozilla.com/D12795

--HG--
extra : moz-landing-system : lando
2018-11-26 21:02:52 +00:00
Nick Alexander
87610d0bca 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`.

Depends on D12792

Differential Revision: https://phabricator.services.mozilla.com/D12793

--HG--
extra : moz-landing-system : lando
2018-11-26 19:16:39 +00:00
Jim Chen
53c6c70b65 Bug 1492308 - 1. Generate natives binding for all JNIObject classes; r=snorp
Right now we skip generating natives binding for a class if the class
doesn't have native methods. However, we should still generate the
natives binding for JNIObject classes because these classes can still be
attached to C++ objects even without native methods.

Differential Revision: https://phabricator.services.mozilla.com/D7106

--HG--
extra : moz-landing-system : lando
2018-10-02 19:59:28 +00:00
Nick Alexander
7df53b6508 Bug 1444546 - Part 4b: Make AnnotationProcessor avoid writing, like Python's FileAvoidWrite. r=jchen
This allows us to invoke AnnotationProcessor more than is strictly
necessary and not trigger expensive native code compilations unless
the native code has actually evolved.

MozReview-Commit-ID: H1BIzJsdyIh

--HG--
extra : rebase_source : 30851f5561d3bc044f2245af5b68bd6f038995dd
2018-03-26 09:36:19 -07:00
Nick Alexander
53a4852ffa Bug 1444546 - Part 3: Use GENERATED_FILES for Android SDK bindings generation. r=froydnj,jchen
MozReview-Commit-ID: 2blmzKTvpj3

--HG--
extra : rebase_source : 0954b407ce6625510eadc67dd9989da949b22110
2018-03-06 19:19:48 -08:00
Nick Alexander
520b63c85e Bug 1444546 - Part 2: Build annotationProcessors with Gradle. r=jchen
We want annotationProcessors to be compiled and archived into a JAR at
build time, ready to generate JNI wrappers.  (That is, until we turn
the whole thing into a real annotation processor.)  But even if we do
use a real annotation processor, we still need to generate SDK
bindings, which is less clearly expressed as an annotation processor.
(It's more of a build step.)

Gradle provides a huge number of ways to organize build logic to
achieve this: see
https://docs.gradle.org/current/userguide/organizing_build_logic.html.
Unfortunately, the best such way -- putting the code into
$topsrcdir/buildSrc -- has key disadvantages:

1) it pollutes the top-level $topsrcdir, and there's no way to change the
location of buildSrc (https://github.com/gradle/gradle/issues/2472);

2) it's complicated to have a dependent project
(mobile/android/annotations) expose its code via a buildSrc project;

3) using buildSrc at all appears to conflict with the Android-Gradle
plugin version that we are using.

Therefore, this commit does something much simpler: it adds a
Java-only project and uses the resulting Gradle "Jar" task and archive
output as input to the existing Gradle "generate JNI wrappers" task.

MozReview-Commit-ID: 2OyYLPneE1M

--HG--
extra : rebase_source : d99b74a0a1e0bb3e8f4d4540978328388e5c2e42
2018-02-22 16:11:14 -08:00
Nick Alexander
90a4b9e4b1 Bug 1444546 - Part 1: hg mv build/annotationProcessors mobile/android/annotations. r=jchen
MozReview-Commit-ID: J3Wz83vWAVX

--HG--
rename : build/annotationProcessors/AnnotationInfo.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/AnnotationInfo.java
rename : build/annotationProcessors/AnnotationProcessor.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/AnnotationProcessor.java
rename : build/annotationProcessors/CodeGenerator.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/CodeGenerator.java
rename : build/annotationProcessors/SDKProcessor.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/SDKProcessor.java
rename : build/annotationProcessors/classloader/AnnotatableEntity.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/classloader/AnnotatableEntity.java
rename : build/annotationProcessors/classloader/ClassWithOptions.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/classloader/ClassWithOptions.java
rename : build/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/classloader/IterableJarLoadingURLClassLoader.java
rename : build/annotationProcessors/classloader/JarClassIterator.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/classloader/JarClassIterator.java
rename : build/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/utils/AlphabeticAnnotatableEntityComparator.java
rename : build/annotationProcessors/utils/GeneratableElementIterator.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/utils/GeneratableElementIterator.java
rename : build/annotationProcessors/utils/Utils.java => mobile/android/annotations/src/main/java/org/mozilla/gecko/annotationProcessors/utils/Utils.java
extra : rebase_source : 65b85ec338cc5a7cb12afc2ad7678271339a6e89
2018-02-22 13:51:15 -08:00