File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
build-logic/jvm/src/main/kotlin Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 1
1
import com.github.vlsi.gradle.dsl.configureEach
2
- import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2
+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3
+ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
4
+ import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
3
5
4
6
plugins {
5
7
id(" java-library" )
@@ -26,12 +28,12 @@ autostyle {
26
28
}
27
29
}
28
30
29
- tasks.configureEach<KotlinCompile > {
30
- kotlinOptions {
31
+ tasks.configureEach<KotlinJvmCompile > {
32
+ compilerOptions {
31
33
if (! name.startsWith(" compileTest" )) {
32
- apiVersion = " kotlin.api" .v
34
+ apiVersion = KotlinVersion .fromVersion( " kotlin.api" .v)
33
35
}
34
- freeCompilerArgs + = " -Xjvm-default=all"
36
+ freeCompilerArgs.add( " -Xjvm-default=all" )
35
37
val jdkRelease = buildParameters.targetJavaVersion.let {
36
38
when {
37
39
it < 9 -> " 1.8"
@@ -42,8 +44,8 @@ tasks.configureEach<KotlinCompile> {
42
44
buildParameters.buildJdkVersion
43
45
.takeIf { it > 8 }
44
46
?.let {
45
- freeCompilerArgs + = " -Xjdk-release=$jdkRelease "
47
+ freeCompilerArgs.add( " -Xjdk-release=$jdkRelease " )
46
48
}
47
- kotlinOptions. jvmTarget = jdkRelease
49
+ jvmTarget = JvmTarget .fromTarget( jdkRelease)
48
50
}
49
51
}
You can’t perform that action at this time.
0 commit comments