Fix kotlin annotation processing after java_plugin
I37c1e80eba71ae2d6a06199fb102194a51994989 broke kotlin annotation
processing with a typo in the processors flag to kapt and by
passing -processor to javac with an empty processorpath.
Bug: 77284273
Bug: 122251693
Test: kotlin_test.go
Test: m checkbuild
Change-Id: I17c45d5b3f9df089231af5d2930646ad0e6bf9be
diff --git a/java/java.go b/java/java.go
index 7014668..89b09d1 100644
--- a/java/java.go
+++ b/java/java.go
@@ -493,7 +493,7 @@
// 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 {
+ if len(j.properties.Annotation_processors) > 0 || len(j.properties.Plugins) > 0 {
ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations")
}
}
@@ -1017,6 +1017,7 @@
srcJars = append(srcJars, kaptSrcJar)
// Disable annotation processing in javac, it's already been handled by kapt
flags.processorPath = nil
+ flags.processor = ""
}
kotlinJar := android.PathForModuleOut(ctx, "kotlin", jarName)