Commit Graph

4 Commits

Author SHA1 Message Date
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