From 29de9363b775fdf2075752292fb7e4b16ebc03b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 12:29:14 +0000 Subject: [PATCH 1/3] chore(deps): update kotlin monorepo to v2 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e31172ef..5bc4c86d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ java = "17" junitJupiter = "5.10.2" kluent = "1.73" kotest = "5.9.0" -kotlin = "1.9.24" +kotlin = "2.0.0" # See https://github.com/detekt/detekt/issues/6198 detektKotlinVersion = "1.9.22" mockk = "1.13.11" From f2215f6ae8d9b68010815e2e19d27adb3f5d29cf Mon Sep 17 00:00:00 2001 From: Urs Joss Date: Fri, 24 May 2024 16:11:25 +0200 Subject: [PATCH 2/3] avoid kotlinCompile --- build.gradle.kts | 37 ++++++-------------- gradle-plugins/publishing/build.gradle.kts | 6 +--- gradle-plugins/verification/build.gradle.kts | 4 +-- subprojects/kris-guide/kris-guide.gradle.kts | 10 ------ 4 files changed, 13 insertions(+), 44 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9220dd86..115355e6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,5 @@ import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.gradle.DokkaTaskPartial -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.net.URI buildscript { @@ -24,6 +23,10 @@ plugins { jacoco } +kotlin { + jvmToolchain(libs.versions.java.get().toInt()) +} + jacoco { toolVersion = libs.versions.jacoco.get() } @@ -51,6 +54,8 @@ nexusPublishing { } } +val kotlinSrcSet = "/src/main/kotlin" + tasks { val deleteOutFolderTask by registering(Delete::class) { delete("out") @@ -72,14 +77,6 @@ tasks { } } -kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get())) - } -} - -val kotlinSrcSet = "/src/main/kotlin" - subprojects.forEach { subProject -> if (subProject.name in setOf("kris-core", "kris-io")) { apply { @@ -99,23 +96,16 @@ subprojects.forEach { subProject -> } } } + subProject.tasks { - val kotlinVersion = libs.versions.kotlin.get() - val kotlinApiLangVersion = kotlinVersion.subSequence(0, 3).toString() - val jvmTargetVersion = libs.versions.java.get() - withType().configureEach { - kotlinOptions { + named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java) { + val kotlinApiLangVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.fromVersion(libs.versions.kotlin.get().take(3)) + compilerOptions { apiVersion = kotlinApiLangVersion languageVersion = kotlinApiLangVersion - jvmTarget = jvmTargetVersion - freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=kotlin.RequiresOptIn") + freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") } } - withType().configureEach { - sourceCompatibility = jvmTargetVersion - targetCompatibility = jvmTargetVersion - } - withType { useJUnitPlatform { includeEngines("junit-jupiter", "kotest") @@ -128,11 +118,6 @@ subprojects.forEach { subProject -> } } } - kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get())) - } - } } } diff --git a/gradle-plugins/publishing/build.gradle.kts b/gradle-plugins/publishing/build.gradle.kts index ea3561b3..5a2f45c2 100644 --- a/gradle-plugins/publishing/build.gradle.kts +++ b/gradle-plugins/publishing/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile - @Suppress("DSL_SCOPE_VIOLATION") plugins { `java-gradle-plugin` @@ -8,9 +6,7 @@ plugins { } kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get())) - } + jvmToolchain(libs.versions.java.get().toInt()) } dependencies { diff --git a/gradle-plugins/verification/build.gradle.kts b/gradle-plugins/verification/build.gradle.kts index 72ebd5e8..8a7cb384 100644 --- a/gradle-plugins/verification/build.gradle.kts +++ b/gradle-plugins/verification/build.gradle.kts @@ -13,9 +13,7 @@ dependencies { } kotlin { - jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get())) - } + jvmToolchain(libs.versions.java.get().toInt()) } detekt { diff --git a/subprojects/kris-guide/kris-guide.gradle.kts b/subprojects/kris-guide/kris-guide.gradle.kts index bc0fd1a0..b0c050d4 100644 --- a/subprojects/kris-guide/kris-guide.gradle.kts +++ b/subprojects/kris-guide/kris-guide.gradle.kts @@ -1,18 +1,8 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { `java-library` kotlin("jvm") } -tasks { - withType().configureEach { - kotlinOptions { - jvmTarget = libs.versions.java.get() - } - } -} - dependencies { testImplementation(project(":kris-io")) From 718cbf78be12a12cb6aa803e58ff16b812def8f8 Mon Sep 17 00:00:00 2001 From: Urs Joss Date: Fri, 24 May 2024 16:22:03 +0200 Subject: [PATCH 3/3] avoid kotlinCompile --- build.gradle.kts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 115355e6..ae802487 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,14 +98,6 @@ subprojects.forEach { subProject -> } subProject.tasks { - named("compileKotlin", org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java) { - val kotlinApiLangVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.fromVersion(libs.versions.kotlin.get().take(3)) - compilerOptions { - apiVersion = kotlinApiLangVersion - languageVersion = kotlinApiLangVersion - freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn") - } - } withType { useJUnitPlatform { includeEngines("junit-jupiter", "kotest")