diff options
author | Colin Cross <ccross@android.com> | 2019-01-23 16:14:02 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-01-24 23:48:04 +0000 |
commit | 7788c1283fcfe00b59d500fdc3b01ff39049e7ed (patch) | |
tree | 4bdd29ce554a8952e8462c8141b59f40751e771f /java | |
parent | 11ecdd69798c12ab0657aa6fdd03b44ddadda6ad (diff) | |
download | android_build_soong-7788c1283fcfe00b59d500fdc3b01ff39049e7ed.tar.gz android_build_soong-7788c1283fcfe00b59d500fdc3b01ff39049e7ed.tar.bz2 android_build_soong-7788c1283fcfe00b59d500fdc3b01ff39049e7ed.zip |
Remove annotation_processors property
Now that there are no uses left of annotation_processors remove
the property.
If there are no annotation processor classes for javac for a module,
due to an empty "plugins" property or using kapt for annotation
processors, pass -proc:none to javac to ensure it does not try
to run any annotation processors found in the classpath.
Bug: 77284273
Test: plugin_test.go, kotlin_test.go
Change-Id: I3823d9fec8d3d07d2e49b1d97839f7fcbdd35647
Diffstat (limited to 'java')
-rw-r--r-- | java/builder.go | 3 | ||||
-rw-r--r-- | java/java.go | 11 | ||||
-rw-r--r-- | java/kotlin_test.go | 5 | ||||
-rw-r--r-- | java/plugin_test.go | 5 |
4 files changed, 6 insertions, 18 deletions
diff --git a/java/builder.go b/java/builder.go index 67e8235b..df17f7b9 100644 --- a/java/builder.go +++ b/java/builder.go @@ -255,8 +255,7 @@ func transformJavaToClasses(ctx android.ModuleContext, outputFile android.Writab deps = append(deps, flags.classpath...) deps = append(deps, flags.processorPath...) - // TODO(b/77284273): pass -processor:none if no plugins are listed - processor := "" + processor := "-proc:none" if flags.processor != "" { processor = "-processor " + flags.processor } diff --git a/java/java.go b/java/java.go index a76cde54..b070639b 100644 --- a/java/java.go +++ b/java/java.go @@ -114,9 +114,6 @@ type CompilerProperties struct { // If set to true, include sources used to compile the module in to the final jar Include_srcs *bool - // List of modules to use as annotation processors. Deprecated, use plugins instead. - Annotation_processors []string - // List of modules to use as annotation processors Plugins []string @@ -376,7 +373,6 @@ type jniDependencyTag struct { var ( staticLibTag = dependencyTag{name: "staticlib"} libTag = dependencyTag{name: "javalib"} - annoTag = dependencyTag{name: "annotation processor"} pluginTag = dependencyTag{name: "plugin"} bootClasspathTag = dependencyTag{name: "bootclasspath"} systemModulesTag = dependencyTag{name: "system modules"} @@ -471,9 +467,6 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { ctx.AddVariationDependencies(nil, libTag, j.properties.Libs...) ctx.AddVariationDependencies(nil, staticLibTag, j.properties.Static_libs...) - ctx.AddFarVariationDependencies([]blueprint.Variation{ - {Mutator: "arch", Variation: ctx.Config().BuildOsCommonVariant}, - }, annoTag, j.properties.Annotation_processors...) ctx.AddFarVariationDependencies([]blueprint.Variation{ {Mutator: "arch", Variation: ctx.Config().BuildOsCommonVariant}, @@ -493,7 +486,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { // TODO(ccross): move this to a mutator pass that can tell if generated sources contain // Kotlin files ctx.AddVariationDependencies(nil, kotlinStdlibTag, "kotlin-stdlib") - if len(j.properties.Annotation_processors) > 0 || len(j.properties.Plugins) > 0 { + if len(j.properties.Plugins) > 0 { ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations") } } @@ -718,8 +711,6 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { deps.staticResourceJars = append(deps.staticResourceJars, dep.ResourceJars()...) // sdk lib names from dependencies are re-exported j.exportedSdkLibs = append(j.exportedSdkLibs, dep.ExportedSdkLibs()...) - case annoTag: - deps.processorPath = append(deps.processorPath, dep.ImplementationAndResourcesJars()...) case pluginTag: if plugin, ok := dep.(*Plugin); ok { deps.processorPath = append(deps.processorPath, dep.ImplementationAndResourcesJars()...) diff --git a/java/kotlin_test.go b/java/kotlin_test.go index 9406ef9d..e0eb0c06 100644 --- a/java/kotlin_test.go +++ b/java/kotlin_test.go @@ -149,9 +149,8 @@ func TestKapt(t *testing.T) { if javac.Args["processorPath"] != "" { t.Errorf("expected processorPath '', got %q", javac.Args["processorPath"]) } - // TODO(b/77284273): test for -processor:none - if javac.Args["processor"] != "" { - t.Errorf("expected processor '', got %q", javac.Args["processor"]) + if javac.Args["processor"] != "-proc:none" { + t.Errorf("expected processor '-proc:none', got %q", javac.Args["processor"]) } } diff --git a/java/plugin_test.go b/java/plugin_test.go index 7aa0164f..d1aef2c1 100644 --- a/java/plugin_test.go +++ b/java/plugin_test.go @@ -38,9 +38,8 @@ func TestNoPlugin(t *testing.T) { t.Errorf("want empty processorpath, got %q", javac.Args["processorpath"]) } - // TODO(b/77284273): test for -processor:none if no plugins are enabled - if javac.Args["processor"] != "" { - t.Errorf("want no -processor argument, got %q", javac.Args["processor"]) + if javac.Args["processor"] != "-proc:none" { + t.Errorf("want '-proc:none' argument, got %q", javac.Args["processor"]) } } |