Repeat kapt processor argument for multiple processors
kapt claims to support a comma separated list of annotation
processors, but it errors if multiple annotation processors
are given. Surrounding the the list with {} does not error,
but it also doesn't even warn if the second element in the
list is garbage, so it may not be running the second
processor. Repeat the processor argument for each
annotation processor class instead.
Bug: 154736649
Test: TestKapt
Test: m checkbuild
Change-Id: I4c7c161dbf867d7fba1aaf16fd5e502647e3f682
diff --git a/java/builder.go b/java/builder.go
index 3a0247d..770e255 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -191,7 +191,7 @@
classpath classpath
java9Classpath classpath
processorPath classpath
- processor string
+ processors []string
systemModules *systemModules
aidlFlags string
aidlDeps android.Paths
@@ -265,8 +265,8 @@
deps = append(deps, flags.processorPath...)
processor := "-proc:none"
- if flags.processor != "" {
- processor = "-processor " + flags.processor
+ if len(flags.processors) > 0 {
+ processor = "-processor " + strings.Join(flags.processors, ",")
}
intermediatesDir := "xref"
@@ -380,8 +380,8 @@
deps = append(deps, flags.processorPath...)
processor := "-proc:none"
- if flags.processor != "" {
- processor = "-processor " + flags.processor
+ if len(flags.processors) > 0 {
+ processor = "-processor " + strings.Join(flags.processors, ",")
}
srcJarDir := "srcjars"