Add missing dependency on compose plugin in kapt rules
The kapt rule uses kotlincFlags but was not using kotlincDeps,
causing the rule to get the -Xplugin argument on the compose
compiler plugin jar, but not have a dependency on it.
Bug: 231222079
Test: TestKotlinCompose
Change-Id: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
diff --git a/java/kotlin_test.go b/java/kotlin_test.go
index f9ff982..435d782 100644
--- a/java/kotlin_test.go
+++ b/java/kotlin_test.go
@@ -325,6 +325,7 @@
java_library {
name: "withcompose",
srcs: ["a.kt"],
+ plugins: ["plugin"],
static_libs: ["androidx.compose.runtime_runtime"],
}
@@ -332,6 +333,10 @@
name: "nocompose",
srcs: ["a.kt"],
}
+
+ java_plugin {
+ name: "plugin",
+ }
`)
buildOS := result.Config.BuildOS.String()
@@ -346,6 +351,9 @@
android.AssertStringDoesContain(t, "missing compose compiler plugin",
withCompose.VariablesForTestsRelativeToTop()["kotlincFlags"], "-Xplugin="+composeCompiler.String())
+ android.AssertStringListContains(t, "missing kapt compose compiler dependency",
+ withCompose.Rule("kapt").Implicits.Strings(), composeCompiler.String())
+
android.AssertStringListDoesNotContain(t, "unexpected compose compiler dependency",
noCompose.Rule("kotlinc").Implicits.Strings(), composeCompiler.String())