Change compose Compiler. New Soong Exclude_common_Srcs.
Default the kotlin compiler to use language-version 1.9, as
the kotlin compiler is being upgraded to 2.0.21, but not all
of the code yet compiles with 2.0.
Test: m
Bug: 369137871
Change-Id: I1539860eaa39c858fe6f327a434a2e93f4e05018
diff --git a/java/base.go b/java/base.go
index 8dad2d9..c770239 100644
--- a/java/base.go
+++ b/java/base.go
@@ -60,6 +60,9 @@
// This is most useful in the arch/multilib variants to remove non-common files
Exclude_srcs []string `android:"path,arch_variant"`
+ // list of Kotlin source files that should excluded from the list of common_srcs.
+ Exclude_common_srcs []string `android:"path,arch_variant"`
+
// list of directories containing Java resources
Java_resource_dirs []string `android:"arch_variant"`
@@ -918,7 +921,7 @@
if j.useCompose(ctx) {
ctx.AddVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(), kotlinPluginTag,
- "androidx.compose.compiler_compiler-hosted-plugin")
+ "kotlin-compose-compiler-plugin")
}
}
@@ -1178,7 +1181,7 @@
flags = protoFlags(ctx, &j.properties, &j.protoProperties, flags)
}
- kotlinCommonSrcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Common_srcs, nil)
+ kotlinCommonSrcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Common_srcs, j.properties.Exclude_common_srcs)
if len(kotlinCommonSrcFiles.FilterOutByExt(".kt")) > 0 {
ctx.PropertyErrorf("common_srcs", "common_srcs must be .kt files")
}