Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eb48603

Browse files
3flextschuchortdev
authored andcommitted
Set jvmTarget on all Kotlin compilation tasks
Ensures Java & Kotlin compilation tasks have aligned JVM source & target versions. Required when recent Kotlin & Gradle versions are used together.
1 parent e4115fe commit eb48603

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
3+
14
buildscript {
25
ext.kotlin_version = '1.9.10'
36
ext.embedded_kotlin_version = '1.9.10'
@@ -157,6 +160,12 @@ subprojects {
157160

158161
sourceCompatibility = 1.8
159162

163+
tasks.withType(KotlinCompilationTask).configureEach {
164+
compilerOptions {
165+
jvmTarget = JvmTarget.JVM_1_8
166+
}
167+
}
168+
160169
if (JavaVersion.current() >= JavaVersion.VERSION_16) {
161170
test {
162171
jvmArgs = [

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /