summaryrefslogtreecommitdiff
path: root/java/kotlin.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-09-12 18:06:24 +0000
committer Spandan Das <spandandas@google.com> 2024-09-12 18:20:59 +0000
commit3d6c6d9c768b8209be796153d4a2a543c77c99a1 (patch)
treedcd6c97e1ea719d69a32528b26074996ab28f69b /java/kotlin.go
parent600afbe381409e77654f73672491492f4c2aeecd (diff)
Use -language-version 1.9 in the kotlinKythe build rule
There are some instances of .kt code in android platform that are not fully compatible with kotlinc > 2. To account for this version skew when generating xrefs, implicitly add `-language-version 1.9` to the args in the .kzip file. The main kotlinc build rules remain the same. This value has been picked manually by running `external/kotlinc/bin/kotlinc -version` at ToT Bug: 265428637 Test: verified that `-language-version 1.9` is added to the build command of the .kzip files Test: ran the indexer locally on the .kzip of `PermissionController-lib` (this android_library contains .kt code that does not compile with verison >2) Change-Id: Icfb72800404d83f63204de23a1ec34b40ee05847
Diffstat (limited to 'java/kotlin.go')
-rw-r--r--java/kotlin.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/java/kotlin.go b/java/kotlin.go
index 79781a06d..5a76df29d 100644
--- a/java/kotlin.go
+++ b/java/kotlin.go
@@ -65,8 +65,6 @@ var kotlinc = pctx.AndroidRemoteStaticRule("kotlinc", android.RemoteRuleSupports
"headerClassesDir", "headerJar", "kotlinJvmTarget", "kotlinBuildFile", "emptyDir", "name")
var kotlinKytheExtract = pctx.AndroidStaticRule("kotlinKythe",
- // TODO (b/265428637): To prevent kotlinc version skew between android builds and internal kotlin indexers (g3), consider embedding the kotlinc used by android into the kzip file.
- // This has an impact on .kzip sizes, so defer that for now.
blueprint.RuleParams{
Command: `rm -rf "$srcJarDir" && mkdir -p "$srcJarDir" && ` +
`${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" -f "*.kt" $srcJars && ` +
@@ -76,7 +74,8 @@ var kotlinKytheExtract = pctx.AndroidStaticRule("kotlinKythe",
// Skip header jars, those should not have an effect on kythe results.
` --args '${config.KotlincGlobalFlags} ` +
` ${config.KotlincSuppressJDK9Warnings} ${config.JavacHeapFlags} ` +
- ` $kotlincFlags -jvm-target $kotlinJvmTarget'`,
+ ` $kotlincFlags -jvm-target $kotlinJvmTarget ` +
+ `${config.KotlincKytheGlobalFlags}'`,
CommandDeps: []string{
"${config.KotlinKytheExtractor}",
"${config.ZipSyncCmd}",