Skip to content

Commit 98dadfc

Browse files
mhuster23Oleksandr Dzhychko
authored andcommitted
build: adopt new way of jvm configuration
1 parent 9d6fdc9 commit 98dadfc

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ subprojects {
7777
val kotlinApiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_6
7878
subproject.tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
7979
if (!name.lowercase().contains("test")) {
80-
this.kotlinOptions {
81-
jvmTarget = "11"
82-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility", "-Xexpect-actual-classes")
83-
apiVersion = kotlinApiVersion.version
80+
this.compilerOptions {
81+
jvmTarget.set(JvmTarget.JVM_11)
82+
freeCompilerArgs.addAll(listOf("-Xjvm-default=all-compatibility", "-Xexpect-actual-classes"))
83+
apiVersion.set(kotlinApiVersion)
8484
}
8585
}
8686
}
8787
subproject.tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
8888
if (!name.lowercase().contains("test")) {
89-
this.kotlinOptions {
90-
jvmTarget = "11"
91-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility")
92-
apiVersion = kotlinApiVersion.version
89+
this.compilerOptions {
90+
jvmTarget.set(JvmTarget.JVM_11)
91+
freeCompilerArgs.addAll(listOf("-Xjvm-default=all-compatibility"))
92+
apiVersion.set(kotlinApiVersion)
9393
}
9494
}
9595
}

bulk-model-sync-lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
}
44

55
kotlin {
6+
jvmToolchain(11)
67
js(IR) {
78
browser {
89
testTask {
@@ -13,7 +14,6 @@ kotlin {
1314
}
1415
}
1516
jvm {
16-
jvmToolchain(11)
1717
testRuns["test"].executionTask.configure {
1818
useJUnitPlatform()
1919
}

modelql-core/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
/*
24
* Licensed under the Apache License, Version 2.0 (the "License");
35
* you may not use this file except in compliance with the License.
@@ -91,13 +93,11 @@ val generateVersionVariable by tasks.registering {
9193

9294
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
9395
dependsOn(generateVersionVariable)
94-
kotlinOptions {
95-
jvmTarget = "11"
96-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility")
96+
compilerOptions {
97+
jvmTarget.set(JvmTarget.JVM_11)
98+
freeCompilerArgs.add("-Xjvm-default=all-compatibility")
9799
}
98100
}
99101
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().all {
100102
dependsOn(generateVersionVariable)
101-
kotlinOptions {
102-
}
103103
}

modelql-html/build.gradle.kts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
13
/*
24
* Licensed under the Apache License, Version 2.0 (the "License");
35
* you may not use this file except in compliance with the License.
@@ -72,13 +74,13 @@ kotlin {
7274
}
7375

7476
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
75-
kotlinOptions {
76-
jvmTarget = "11"
77-
freeCompilerArgs += listOf("-Xjvm-default=all-compatibility", "-Xcontext-receivers")
77+
compilerOptions {
78+
jvmTarget.set(JvmTarget.JVM_11)
79+
freeCompilerArgs.addAll("-Xjvm-default=all-compatibility", "-Xcontext-receivers")
7880
}
7981
}
8082
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().all {
81-
kotlinOptions {
82-
freeCompilerArgs += listOf("-Xcontext-receivers")
83+
compilerOptions {
84+
freeCompilerArgs.add("-Xcontext-receivers")
8385
}
8486
}

0 commit comments

Comments
 (0)