How can I set
idea {
targetVersion = "13"
}
and
sourceCompatibility = 1.8
from the scala plugin https://docs.gradle.org/current/userguide/scala_plugin.html when building using the gradle kotlin dsl?
How can I set
idea {
targetVersion = "13"
}
and
sourceCompatibility = 1.8
from the scala plugin https://docs.gradle.org/current/userguide/scala_plugin.html when building using the gradle kotlin dsl?
Setting the target version of IDEA is a simple copy-paste:
build.gradle:
idea { targetVersion = "13" }
build.gradle.kts:
idea {
targetVersion = "13"
}
Setting the sourceCompatibility
is a bit trickier:
build.gradle:
sourceCompatibility = 1.8
build.gradle.kts:
tasks.withType<ScalaCompile> {
sourceCompatibility = "1.8"
}
Do note however, that the Gradle Scala plugin docs state that the sourceCompatibility
option is basically a no-op. The compatible Java version is determined by the Scala compiler, where 2.11.x targets Java 1.6, and 2.12.x targets Java 1.8