https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
h

hallvard

10/07/2018, 3:35 PM
With 1.3, I define all the different platforms in one single gradle file, thanks! It really is a great improvement! But does anyone know how I specify the jvm target now? Idea complains I use
assertThrows
in my tests, and this causes a jvm1.6/jvm1.8 clash/mismatch ...
Actually, gradle makes the same complaint:
Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
. Is there a nice keyword to set this in the gradle build file?
Everywhere I look,
jvmTarget
is said to be the keyword (still). But I can't find out where to put it! Argh!
OK, I found it here: https://github.com/JetBrains/kotlin/blob/d0923e7a328a10ad2a18e157da6b9252ddd00d9e/libraries/stdlib/jdk8/build.gradle. So I put in this:
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
    kotlinOptions.jvmTarget = 1.8
}
👍🏻 1