From 66b92c8c9172780c5794f47cbe7ede4eeee009b7 Mon Sep 17 00:00:00 2001 From: Tobias Thierer Date: Thu, 11 May 2017 14:08:12 +0100 Subject: Fix annotation processors working w/ generated code on OpenJDK 9 toolchain 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 --- Android.mk | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3