11import org.gradle.api.JavaVersion.VERSION_17
2- import org.jetbrains.kotlin.config.KotlinCompilerVersion
3- import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
43
54plugins {
65 kotlin(" jvm" )
@@ -16,9 +15,10 @@ dependencies {
1615 testImplementation(name = " spek-dsl-jvm" , version = spekVersion, group = " org.spekframework.spek2" )
1716 testImplementation(name = " atrium-fluent-en_GB" , version = " 0.16.0" , group = " ch.tutteli.atrium" )
1817 testRuntimeOnly(name = " spek-runner-junit5" , version = spekVersion, group = " org.spekframework.spek2" )
18+ testRuntimeOnly(" org.junit.platform:junit-platform-launcher" )
1919
2020 constraints {
21- testImplementation(kotlin(" reflect" , version = KotlinCompilerVersion . VERSION ))
21+ testImplementation(kotlin(" reflect" ))
2222 }
2323}
2424
@@ -29,23 +29,20 @@ java {
2929
3030kotlin {
3131 explicitApi()
32- }
33-
34- tasks.withType<KotlinCompile > {
35- kotlinOptions {
36- jvmTarget = " 17"
37- freeCompilerArgs + = " -Xopt-in=kotlin.io.path.ExperimentalPathApi"
32+ compilerOptions {
33+ jvmTarget = JvmTarget .JVM_17
34+ freeCompilerArgs.add(" -opt-in=kotlin.io.path.ExperimentalPathApi" )
3835 }
3936}
4037
4138tasks.withType<Test > {
4239 useJUnitPlatform()
4340
44- val testPwd = buildDir.resolve (" test-pwd" )
41+ val testPwd = layout.buildDirectory.dir (" test-pwd" )
4542 doFirst {
46- testPwd.mkdirs()
43+ testPwd.get().asFile. mkdirs()
4744 }
48- workingDir = testPwd
45+ workingDir = testPwd.get().asFile
4946}
5047
5148
0 commit comments