From 3a3e94c09a68ff49686f78f9c8a862e2d646bf7d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 23 Jan 2019 15:39:50 -0800 Subject: 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 --- java/java.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'java/java.go') diff --git a/java/java.go b/java/java.go index 7014668f4..89b09d10b 100644 --- a/java/java.go +++ b/java/java.go @@ -493,7 +493,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 { + if len(j.properties.Annotation_processors) > 0 || len(j.properties.Plugins) > 0 { ctx.AddVariationDependencies(nil, kotlinAnnotationsTag, "kotlin-annotations") } } @@ -1017,6 +1017,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path 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) -- cgit v1.2.3-59-g8ed1b