kotlinc: Always pass -jvm-target 1.8
AOSP's current version of kotlinc only supports -jvm-target 1.8 or 1.6. Previously, we were passing the javaVersion (the value passed to javac -target) but that would fail if javaVersion was eg. 1.9. This CL changes the kotlinc invocation to always pass -jvm-target 1.8, regardless of javaVersion. Bug: 69160377 Test: Treehugger Change-Id: Ib12a8c2afbe908319513861a5380e70bf09d0be0
This commit is contained in:
parent
393667285e
commit
96427d63bc
|
@ -65,7 +65,7 @@ var (
|
||||||
// maximum number of input files, especially on darwin.
|
// maximum number of input files, especially on darwin.
|
||||||
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` +
|
||||||
`${config.KotlincCmd} $classpath $kotlincFlags ` +
|
`${config.KotlincCmd} $classpath $kotlincFlags ` +
|
||||||
`-jvm-target $javaVersion -d $outDir $in && ` +
|
`-jvm-target $kotlinJvmTarget -d $outDir $in && ` +
|
||||||
`${config.SoongZipCmd} -jar -o $out -C $outDir -D $outDir`,
|
`${config.SoongZipCmd} -jar -o $out -C $outDir -D $outDir`,
|
||||||
CommandDeps: []string{
|
CommandDeps: []string{
|
||||||
"${config.KotlincCmd}",
|
"${config.KotlincCmd}",
|
||||||
|
@ -73,7 +73,7 @@ var (
|
||||||
"${config.SoongZipCmd}",
|
"${config.SoongZipCmd}",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"kotlincFlags", "classpath", "outDir", "javaVersion")
|
"kotlincFlags", "classpath", "outDir", "kotlinJvmTarget")
|
||||||
|
|
||||||
errorprone = pctx.AndroidStaticRule("errorprone",
|
errorprone = pctx.AndroidStaticRule("errorprone",
|
||||||
blueprint.RuleParams{
|
blueprint.RuleParams{
|
||||||
|
@ -208,7 +208,8 @@ func TransformKotlinToClasses(ctx android.ModuleContext, outputFile android.Writ
|
||||||
"classpath": flags.kotlincClasspath.FormJavaClassPath("-classpath"),
|
"classpath": flags.kotlincClasspath.FormJavaClassPath("-classpath"),
|
||||||
"kotlincFlags": flags.kotlincFlags,
|
"kotlincFlags": flags.kotlincFlags,
|
||||||
"outDir": classDir.String(),
|
"outDir": classDir.String(),
|
||||||
"javaVersion": flags.javaVersion,
|
// http://b/69160377 kotlinc only supports -jvm-target 1.6 and 1.8
|
||||||
|
"kotlinJvmTarget": "1.8",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue