diff options
author | Tobias Thierer <tobiast@google.com> | 2017-05-17 16:54:47 +0100 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2017-05-24 22:21:51 +0100 |
commit | b4c614c58fafde506a016e8bc41f56e32a3e6b90 (patch) | |
tree | 284b6768b69cb593bc5cc903fbcb6e09857e1aba /Android.mk | |
parent | d4f3a7089333c6a751bf503a59fef88a1db6df51 (diff) | |
download | dagger2-b4c614c58fafde506a016e8bc41f56e32a3e6b90.tar.gz |
Fix annotation processors working w/ generated code on OpenJDK 9 toolchainandroid-o-preview-3
Generated code is annotated with @javax.annotation.Generated.
Annotation processors working with such code break on OpenJDK 9
toolchains because that class lives in the module
"java.xml.ws.annotation".
This CL makes that module available by adding the javac command
line flag
-J--add-modules=java.xml.ws.annotation to javac
When the environment variable EXPERIMENTAL_USE_OPENJDK9 is set
to true.
Test: make ANDROID_COMPILE_WITH_JACK=false checkbuild tests \
&& make checkbuild tests
(with OpenJDK 8u45 toolchain on the PATH)
Test: make EXPERIMENTAL_USE_OPENJDK9=true \
ANDROID_COMPILE_WITH_JACK=false checkbuild
(with jdk 9-ea+170 toolchain on the PATH)
Bug: 62050818
Change-Id: Ib3e19621a0e24f79807be0dd239e9abec3350383
Diffstat (limited to 'Android.mk')
-rw-r--r-- | Android.mk | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk index deb2fea3c..f31845d1e 100644 --- a/Android.mk +++ b/Android.mk @@ -57,6 +57,8 @@ include $(CLEAR_VARS) LOCAL_MODULE := dagger2-compiler-host LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := JAVA_LIBRARIES +# Required for use of javax.annotation.Generated per http://b/62050818 +LOCAL_JAVACFLAGS := $(if $(EXPERIMENTAL_USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation,) LOCAL_SRC_FILES := $(call all-java-files-under, compiler/src/main/java/) # Manually include META-INF/services/javax.annotation.processing.Processor |