Translate LOCAL_ANNOTATION_PROCESSORS to java_plugin

The annotation_processors property is deprected, translate
LOCAL_ANNOTATION_PROCESSORS to plugins instead.  Also remove
LOCAL_ANNOTATION_PROCESSOR_CLASSES properties, they are
retrieved from java_plugin dependencies instead.

Bug: 77284273
Test: androidmk_test.go
Change-Id: If6f6177262d5579e03bae58d9eb54a599e3da786
This commit is contained in:
Colin Cross 2019-01-23 15:49:00 -08:00
parent c32c6b0d79
commit 11ecdd6979
2 changed files with 20 additions and 2 deletions

View file

@ -69,6 +69,8 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){
"LOCAL_BUILT_MODULE_STEM": skip,
"LOCAL_USE_AAPT2": skip, // Always enabled in Soong
"LOCAL_JAR_EXCLUDE_FILES": skip, // Soong never excludes files from jars
"LOCAL_ANNOTATION_PROCESSOR_CLASSES": skip, // Soong gets the processor classes from the plugin
}
// adds a group of properties all having the same type
@ -147,8 +149,7 @@ func init() {
"LOCAL_COMPATIBILITY_SUITE": "test_suites",
"LOCAL_OVERRIDES_PACKAGES": "overrides",
"LOCAL_ANNOTATION_PROCESSORS": "annotation_processors",
"LOCAL_ANNOTATION_PROCESSOR_CLASSES": "annotation_processor_classes",
"LOCAL_ANNOTATION_PROCESSORS": "plugins",
"LOCAL_PROGUARD_FLAGS": "optimize.proguard_flags",
"LOCAL_PROGUARD_FLAG_FILES": "optimize.proguard_flags_files",

View file

@ -805,6 +805,23 @@ java_library_host {
name: "foolib-host",
defaults: ["cts_defaults"],
}
`,
},
{
desc: "LOCAL_ANNOTATION_PROCESSORS",
in: `
include $(CLEAR_VARS)
LOCAL_MODULE := foolib
LOCAL_ANNOTATION_PROCESSORS := bar
LOCAL_ANNOTATION_PROCESSOR_CLASSES := com.bar
include $(BUILD_STATIC_JAVA_LIBRARY)
`,
expected: `
java_library {
name: "foolib",
plugins: ["bar"],
}
`,
},
}