summaryrefslogtreecommitdiff
path: root/java/kotlin_test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-05-02 13:59:33 -0700
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2022-05-03 17:07:27 +0000
commitdddb402c02837fefe670a1c4826f5b4190ba2ec9 (patch)
treef633cef117e3440ec60105ec63911dccb78f3f8a /java/kotlin_test.go
parentfe45ae8febea3d90f32177007a5df6e83ddb7b36 (diff)
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 (cherry picked from commit 08b0a1cd795a3a30d45ef8ff9f52f6b58fc45304) Merged-In: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
Diffstat (limited to 'java/kotlin_test.go')
-rw-r--r--java/kotlin_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/java/kotlin_test.go b/java/kotlin_test.go
index f9ff98229..435d78294 100644
--- a/java/kotlin_test.go
+++ b/java/kotlin_test.go
@@ -325,6 +325,7 @@ func TestKotlinCompose(t *testing.T) {
java_library {
name: "withcompose",
srcs: ["a.kt"],
+ plugins: ["plugin"],
static_libs: ["androidx.compose.runtime_runtime"],
}
@@ -332,6 +333,10 @@ func TestKotlinCompose(t *testing.T) {
name: "nocompose",
srcs: ["a.kt"],
}
+
+ java_plugin {
+ name: "plugin",
+ }
`)
buildOS := result.Config.BuildOS.String()
@@ -346,6 +351,9 @@ func TestKotlinCompose(t *testing.T) {
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())