diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/base.go | 7 | ||||
-rw-r--r-- | java/config/kotlin.go | 2 | ||||
-rw-r--r-- | java/kotlin_test.go | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/java/base.go b/java/base.go index c0ac4ab99..f26404b8c 100644 --- a/java/base.go +++ b/java/base.go @@ -60,6 +60,9 @@ type CommonProperties struct { // 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"` @@ -922,7 +925,7 @@ func (j *Module) deps(ctx android.BottomUpMutatorContext) { if j.useCompose(ctx) { ctx.AddVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(), kotlinPluginTag, - "androidx.compose.compiler_compiler-hosted-plugin") + "kotlin-compose-compiler-plugin") } } @@ -1182,7 +1185,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath 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") } diff --git a/java/config/kotlin.go b/java/config/kotlin.go index 302d021db..bf4c886d1 100644 --- a/java/config/kotlin.go +++ b/java/config/kotlin.go @@ -49,7 +49,7 @@ func init() { "-J--add-opens=java.base/java.util=ALL-UNNAMED", // https://youtrack.jetbrains.com/issue/KT-43704 }, " ")) - pctx.StaticVariable("KotlincGlobalFlags", strings.Join([]string{}, " ")) + pctx.StaticVariable("KotlincGlobalFlags", strings.Join([]string{"-language-version 1.9"}, " ")) // Use KotlincKytheGlobalFlags to prevent kotlinc version skew issues between android and // g3 kythe indexers. // This is necessary because there might be instances of kotlin code in android diff --git a/java/kotlin_test.go b/java/kotlin_test.go index 45eac0134..ad8734d62 100644 --- a/java/kotlin_test.go +++ b/java/kotlin_test.go @@ -501,7 +501,7 @@ func TestKotlinCompose(t *testing.T) { } kotlin_plugin { - name: "androidx.compose.compiler_compiler-hosted-plugin", + name: "kotlin-compose-compiler-plugin", } java_library { @@ -523,7 +523,7 @@ func TestKotlinCompose(t *testing.T) { buildOS := result.Config.BuildOS.String() - composeCompiler := result.ModuleForTests("androidx.compose.compiler_compiler-hosted-plugin", buildOS+"_common").Rule("combineJar").Output + composeCompiler := result.ModuleForTests("kotlin-compose-compiler-plugin", buildOS+"_common").Rule("combineJar").Output withCompose := result.ModuleForTests("withcompose", "android_common") noCompose := result.ModuleForTests("nocompose", "android_common") |