summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Thierer <tobiast@google.com>2017-05-11 14:08:12 +0100
committerTobias Thierer <tobiast@google.com>2017-05-24 22:22:05 +0100
commit66b92c8c9172780c5794f47cbe7ede4eeee009b7 (patch)
treec07d3d639fc26ba97b1ab91868f49c1770bdd82b
parent1109791bea6e6265ad4e9d1bb59de8c6aa8c066b (diff)
downloaddesugar-66b92c8c9172780c5794f47cbe7ede4eeee009b7.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: I1537980313675ae92a5033258182f9fe69fe4f19
-rw-r--r--Android.mk2
1 files changed, 2 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk
index 5533013..2288d69 100644
--- a/Android.mk
+++ b/Android.mk
@@ -15,6 +15,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_IS_HOST_MODULE := true
+# Required for use of javax.annotation.Generated per http://b/62050818
+LOCAL_JAVACFLAGS := $(if $(EXPERIMENTAL_USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation,)
# Use Dagger2 annotation processor
# b/25860419: annotation processors must be explicitly specified for grok