diff --git a/base/build.gradle.kts b/base/build.gradle.kts index f83c4a6..841f32e 100644 --- a/base/build.gradle.kts +++ b/base/build.gradle.kts @@ -1,6 +1,5 @@ import org.gradle.api.JavaVersion.VERSION_17 -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -16,9 +15,10 @@ dependencies { testImplementation(name = "spek-dsl-jvm", version = spekVersion, group = "org.spekframework.spek2") testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") testRuntimeOnly(name = "spek-runner-junit5", version = spekVersion, group = "org.spekframework.spek2") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } @@ -29,23 +29,19 @@ java { kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "17" - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } } tasks.withType { useJUnitPlatform() - val testPwd = buildDir.resolve("test-pwd") + val testPwd = layout.buildDirectory.dir("test-pwd") doFirst { - testPwd.mkdirs() + testPwd.get().asFile.mkdirs() } - workingDir = testPwd + workingDir = testPwd.get().asFile } diff --git a/base/src/main/kotlin/DefaultTestFiles.kt b/base/src/main/kotlin/DefaultTestFiles.kt index edccfb3..c84a011 100644 --- a/base/src/main/kotlin/DefaultTestFiles.kt +++ b/base/src/main/kotlin/DefaultTestFiles.kt @@ -159,7 +159,7 @@ public class DefaultTestFiles: TestFiles { private val unixInvalidCharacters get() = Regex("[/\u0000]") private val windowsInvalidCharacters get() = Regex("[/\\\\<>:\"|?*\u0000]") private val invalidFileNameCharacters by lazy(PUBLICATION) { - val osName = System.getProperty("os.name").toLowerCase() + val osName = System.getProperty("os.name").lowercase() if (setOf("nix", "nux", "aix", "mac").any { osName.contains(it) }) unixInvalidCharacters else windowsInvalidCharacters // default to windows because it is the most restrictive } diff --git a/build.gradle.kts b/build.gradle.kts index 4ef9848..cd86adb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,7 +6,7 @@ plugins { id("org.jetbrains.dokka-javadoc") version "2.1.0" apply false `maven-publish` signing - id("io.github.gradle-nexus.publish-plugin") version "1.3.0" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" idea } @@ -150,10 +150,10 @@ subprojects { tasks.register("release") { group = "release" description = "Releases the project to all remote repositories" - dependsOn(publishToGithub, publishToMavenCentral, rootProject.tasks.closeAndReleaseStagingRepository) + dependsOn(publishToGithub, publishToMavenCentral, rootProject.tasks.closeAndReleaseStagingRepositories) } - rootProject.tasks.closeAndReleaseStagingRepository { mustRunAfter(publishToMavenCentral) } + rootProject.tasks.closeAndReleaseStagingRepositories { mustRunAfter(publishToMavenCentral) } } } diff --git a/kotest/build.gradle.kts b/kotest/build.gradle.kts index 5841811..c5b376d 100644 --- a/kotest/build.gradle.kts +++ b/kotest/build.gradle.kts @@ -1,6 +1,5 @@ import org.gradle.api.JavaVersion.VERSION_17 -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -19,9 +18,10 @@ dependencies { testImplementation(name = "kotest-runner-junit5", version = kotestVersion, group = "io.kotest") testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } @@ -32,17 +32,8 @@ java { kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "17" - } -} - -tasks.compileTestKotlin { - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } } diff --git a/spek/build.gradle.kts b/spek/build.gradle.kts index dad334f..f776992 100644 --- a/spek/build.gradle.kts +++ b/spek/build.gradle.kts @@ -1,6 +1,5 @@ import org.gradle.api.JavaVersion.VERSION_17 -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -21,9 +20,10 @@ dependencies { testImplementation(name = "spek-dsl-jvm", version = spekVersion, group = "org.spekframework.spek2") testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") testRuntimeOnly(name = "spek-runner-junit5", version = spekVersion, group = "org.spekframework.spek2") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } @@ -34,17 +34,8 @@ java { kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "17" - } -} - -tasks.compileTestKotlin { - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } }