diff options
author | Tobias Thierer <tobiast@google.com> | 2017-11-18 03:10:51 +0000 |
---|---|---|
committer | Tobias Thierer <tobiast@google.com> | 2017-11-18 04:11:59 +0000 |
commit | 96427d63bc098d6cf98225642f02836962fc9c75 (patch) | |
tree | 7e9d3a194e0aeaa4a0f4583f1b5e64c9e5b08ac7 /java/builder.go | |
parent | 393667285ef6845a1cf4675b266158df544ce994 (diff) | |
download | build_soong-96427d63bc098d6cf98225642f02836962fc9c75.tar.gz build_soong-96427d63bc098d6cf98225642f02836962fc9c75.tar.bz2 build_soong-96427d63bc098d6cf98225642f02836962fc9c75.zip |
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
Diffstat (limited to 'java/builder.go')
-rw-r--r-- | java/builder.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/java/builder.go b/java/builder.go index d2e02fde..4be3b04a 100644 --- a/java/builder.go +++ b/java/builder.go @@ -65,7 +65,7 @@ var ( // maximum number of input files, especially on darwin. Command: `rm -rf "$outDir" && mkdir -p "$outDir" && ` + `${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`, CommandDeps: []string{ "${config.KotlincCmd}", @@ -73,7 +73,7 @@ var ( "${config.SoongZipCmd}", }, }, - "kotlincFlags", "classpath", "outDir", "javaVersion") + "kotlincFlags", "classpath", "outDir", "kotlinJvmTarget") errorprone = pctx.AndroidStaticRule("errorprone", blueprint.RuleParams{ @@ -208,7 +208,8 @@ func TransformKotlinToClasses(ctx android.ModuleContext, outputFile android.Writ "classpath": flags.kotlincClasspath.FormJavaClassPath("-classpath"), "kotlincFlags": flags.kotlincFlags, "outDir": classDir.String(), - "javaVersion": flags.javaVersion, + // http://b/69160377 kotlinc only supports -jvm-target 1.6 and 1.8 + "kotlinJvmTarget": "1.8", }, }) } |