Run ErrorProne in OpenJDK9

Run ErrorProne as a processor in javac from OpenJDK9.

Bug: 69485063
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I2dde597430b47c440df22d248809233a6ade1625
This commit is contained in:
Colin Cross 2018-06-19 22:50:13 -07:00
parent 560890b29f
commit e46727a2ba
4 changed files with 13 additions and 18 deletions

View File

@ -730,11 +730,7 @@ ANDROID_MANIFEST_MERGER := $(JAVA) \
COLUMN:= column COLUMN:= column
ifeq ($(EXPERIMENTAL_USE_OPENJDK9),) ifeq ($(EXPERIMENTAL_USE_OPENJDK9),)
ifeq ($(RUN_ERROR_PRONE),true)
USE_OPENJDK9 :=
else
USE_OPENJDK9 := true USE_OPENJDK9 := true
endif
TARGET_OPENJDK9 := TARGET_OPENJDK9 :=
else ifeq ($(EXPERIMENTAL_USE_OPENJDK9),false) else ifeq ($(EXPERIMENTAL_USE_OPENJDK9),false)
USE_OPENJDK9 := USE_OPENJDK9 :=

View File

@ -48,8 +48,3 @@ endif
LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src
LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES)) LOCAL_JAVA_LIBRARIES := $(sort $(LOCAL_JAVA_LIBRARIES))
# If error prone is enabled then add LOCAL_ERROR_PRONE_FLAGS to LOCAL_JAVACFLAGS
ifeq ($(RUN_ERROR_PRONE),true)
LOCAL_JAVACFLAGS += $(LOCAL_ERROR_PRONE_FLAGS)
endif

View File

@ -227,11 +227,6 @@ $(full_classes_compiled_jar): PRIVATE_WARNINGS_ENABLE := $(LOCAL_WARNINGS_ENABLE
# Deps for generated source files must be handled separately, # Deps for generated source files must be handled separately,
# via deps on the target that generates the sources. # via deps on the target that generates the sources.
# If error prone is enabled then add LOCAL_ERROR_PRONE_FLAGS to LOCAL_JAVACFLAGS
ifeq ($(RUN_ERROR_PRONE),true)
LOCAL_JAVACFLAGS += $(LOCAL_ERROR_PRONE_FLAGS)
endif
# For user / userdebug builds, strip the local variable table and the local variable # For user / userdebug builds, strip the local variable table and the local variable
# type table. This has no bearing on stack traces, but will leave less information # type table. This has no bearing on stack traces, but will leave less information
# available via JDWP. # available via JDWP.

View File

@ -193,16 +193,25 @@ ifdef need_compile_java
annotation_processor_flags := annotation_processor_flags :=
annotation_processor_deps := annotation_processor_deps :=
annotation_processor_jars :=
# If error prone is enabled then add LOCAL_ERROR_PRONE_FLAGS to LOCAL_JAVACFLAGS
ifeq ($(RUN_ERROR_PRONE),true)
annotation_processor_jars += $(ERROR_PRONE_JARS)
LOCAL_JAVACFLAGS += $(ERROR_PRONE_FLAGS)
LOCAL_JAVACFLAGS += '-Xplugin:ErrorProne $(ERROR_PRONE_CHECKS) $(LOCAL_ERROR_PRONE_FLAGS)'
endif
ifdef LOCAL_ANNOTATION_PROCESSORS ifdef LOCAL_ANNOTATION_PROCESSORS
annotation_processor_jars := $(call java-lib-files,$(LOCAL_ANNOTATION_PROCESSORS),true) annotation_processor_jars += $(call java-lib-files,$(LOCAL_ANNOTATION_PROCESSORS),true)
annotation_processor_flags += -processorpath $(call normalize-path-list,$(annotation_processor_jars))
annotation_processor_deps += $(annotation_processor_jars)
# b/25860419: annotation processors must be explicitly specified for grok # b/25860419: annotation processors must be explicitly specified for grok
annotation_processor_flags += $(foreach class,$(LOCAL_ANNOTATION_PROCESSOR_CLASSES),-processor $(class)) annotation_processor_flags += $(foreach class,$(LOCAL_ANNOTATION_PROCESSOR_CLASSES),-processor $(class))
endif
annotation_processor_jars := ifneq (,$(strip $(annotation_processor_jars)))
annotation_processor_flags += -processorpath $(call normalize-path-list,$(annotation_processor_jars))
annotation_processor_deps += $(annotation_processor_jars)
endif endif
full_static_java_libs := $(call java-lib-files,$(LOCAL_STATIC_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE)) full_static_java_libs := $(call java-lib-files,$(LOCAL_STATIC_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))