diff options
author | 2025-01-10 14:52:42 +0000 | |
---|---|---|
committer | 2025-01-10 14:52:42 +0000 | |
commit | 20b0ce599ccec66e5f28390eeaa6ed39ab721100 (patch) | |
tree | 1935ecd4e5ec8d07b7532c55ed30da9c29d6f193 /java/base.go | |
parent | 1a7705d96ddaee5fc829c11bca0c43543b9b4155 (diff) |
Add note about kotlin_lang_version
Bug: 383569207
Flag: EXEMPT comment only
Test: comment only
Change-Id: Ic8145c09d9016ae3210b7b26fb97fe9ffd434e34
Diffstat (limited to 'java/base.go')
-rw-r--r-- | java/base.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/java/base.go b/java/base.go index a2fc29de7..63a9426f4 100644 --- a/java/base.go +++ b/java/base.go @@ -1335,6 +1335,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") @@ -1342,7 +1348,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 |