summaryrefslogtreecommitdiff
path: root/java/base.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-17 16:42:58 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-17 16:42:58 -0800
commitdcb4d332958969d4564df510f3a6a4c28df58b11 (patch)
tree3dad6cffbcfe6c1ef60b6bf8e79f5ded6d229665 /java/base.go
parent3fc1942a80feffb0a12aa4573db9cfb8791e1857 (diff)
parent20b0ce599ccec66e5f28390eeaa6ed39ab721100 (diff)
Merge "Add note about kotlin_lang_version" into main
Diffstat (limited to 'java/base.go')
-rw-r--r--java/base.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/java/base.go b/java/base.go
index 0b896d815..ddb2be882 100644
--- a/java/base.go
+++ b/java/base.go
@@ -1336,6 +1336,12 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
kotlincFlags := j.properties.Kotlincflags
CheckKotlincFlags(ctx, kotlincFlags)
+ // Available kotlin versions can be found at
+ // https://github.com/JetBrains/kotlin/blob/master/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt#L560
+ // in the `LanguageVersion` class.
+ // For now, avoid targeting language versions directly, as we'd like to kee our source
+ // code version aligned as much as possible. Ideally, after defaulting to "2", we
+ // can remove the "1.9" option entirely, or at least make it emit a warning.
kotlin_lang_version := proptools.StringDefault(j.properties.Kotlin_lang_version, "1.9")
if kotlin_lang_version == "1.9" {
kotlincFlags = append(kotlincFlags, "-language-version 1.9")
@@ -1343,7 +1349,6 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
kotlincFlags = append(kotlincFlags, "-Xsuppress-version-warnings", "-Xconsistent-data-class-copy-visibility")
} else {
ctx.PropertyErrorf("kotlin_lang_version", "Must be one of `1.9` or `2`")
-
}
// Workaround for KT-46512