Skip to content

Commit

Permalink
chore(deps): update kotlin monorepo to v2 (major) (#254)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored May 24, 2024
1 parent 4dd608b commit 5d27477
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 49 deletions.
37 changes: 7 additions & 30 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -24,6 +23,10 @@ plugins {
jacoco
}

kotlin {
jvmToolchain(libs.versions.java.get().toInt())
}

jacoco {
toolVersion = libs.versions.jacoco.get()
}
Expand Down Expand Up @@ -51,6 +54,8 @@ nexusPublishing {
}
}

val kotlinSrcSet = "/src/main/kotlin"

tasks {
val deleteOutFolderTask by registering(Delete::class) {
delete("out")
Expand All @@ -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 {
Expand All @@ -99,23 +96,8 @@ 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<KotlinCompile>().configureEach {
kotlinOptions {
apiVersion = kotlinApiLangVersion
languageVersion = kotlinApiLangVersion
jvmTarget = jvmTargetVersion
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=kotlin.RequiresOptIn")
}
}
withType<JavaCompile>().configureEach {
sourceCompatibility = jvmTargetVersion
targetCompatibility = jvmTargetVersion
}

subProject.tasks {
withType<Test> {
useJUnitPlatform {
includeEngines("junit-jupiter", "kotest")
Expand All @@ -128,11 +110,6 @@ subprojects.forEach { subProject ->
}
}
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
}
}
}
}

Expand Down
6 changes: 1 addition & 5 deletions gradle-plugins/publishing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
`java-gradle-plugin`
Expand All @@ -8,9 +6,7 @@ plugins {
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
}
jvmToolchain(libs.versions.java.get().toInt())
}

dependencies {
Expand Down
4 changes: 1 addition & 3 deletions gradle-plugins/verification/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ dependencies {
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(libs.versions.java.get()))
}
jvmToolchain(libs.versions.java.get().toInt())
}

detekt {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 0 additions & 10 deletions subprojects/kris-guide/kris-guide.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-library`
kotlin("jvm")
}

tasks {
withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = libs.versions.java.get()
}
}
}

dependencies {
testImplementation(project(":kris-io"))

Expand Down

0 comments on commit 5d27477

Please sign in to comment.