From 8d591edce03492e9abaa8aea2bfc6d5f76ca6f1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 09:38:29 +0000 Subject: [PATCH] chore(deps): update kotlin monorepo to v2 (major) (#630) chore(deps): update kotlin monorepo to v2 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitignore | 1 + build.gradle | 6 ++++++ gradle/libs.versions.toml | 2 +- .../starter/modules/plugins/KotlinLibraryPlugin.kt | 8 ++++++++ versioning/build.gradle | 2 ++ .../starter/versioning/plugins/VersioningPlugin.kt | 3 +-- .../project/starter/versioning/VersioningPluginTest.kt | 6 +++--- 7 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8609445b..a7dba7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .gradle .idea .instant-execution-state +.kotlin # Ignore Gradle build output directory build diff --git a/build.gradle b/build.gradle index a3bb0090..49c2e69b 100644 --- a/build.gradle +++ b/build.gradle @@ -26,6 +26,12 @@ allprojects { kotlin { jvmToolchain(libs.versions.java.compilation.get().toInteger()) } + + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask).configureEach { + compilerOptions { + freeCompilerArgs.add("-Xlambdas=class") + } + } } pluginManager.withPlugin("java-gradle-plugin") { configurations { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6fce1fb4..b49e2d8b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ gradle-gradlepublish = "1.2.1" gradle-jacocotestkit = "1.0.12" gradle-detekt = "1.23.6" gradle-doctor = "0.10.0" -mavencentral-kotlin = "1.9.24" +mavencentral-kotlin = "2.0.0" mavencentral-issuechecker = "0.4.0" mavencentral-junit = "5.10.2" mavencentral-assertj = "3.25.3" diff --git a/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt b/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt index 9c6d6b4c..27891c95 100644 --- a/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt +++ b/jvm/src/main/kotlin/com/project/starter/modules/plugins/KotlinLibraryPlugin.kt @@ -53,5 +53,13 @@ class KotlinLibraryPlugin : Plugin { } } } + + pluginManager.withPlugin("java-gradle-plugin") { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask::class.java).configureEach { + compilerOptions { + freeCompilerArgs.add("-Xlambdas=class") + } + } + } } } diff --git a/versioning/build.gradle b/versioning/build.gradle index a8f22aee..d99bb5cc 100644 --- a/versioning/build.gradle +++ b/versioning/build.gradle @@ -12,6 +12,8 @@ dependencies { implementation project(":config") testImplementation project(":testing") + + testRuntimeDependencies(libs.jetbrains.kotlin.jvm.implementation) } tasks.named("test") { diff --git a/versioning/src/main/kotlin/com/project/starter/versioning/plugins/VersioningPlugin.kt b/versioning/src/main/kotlin/com/project/starter/versioning/plugins/VersioningPlugin.kt index aea325b7..0c6e68cf 100644 --- a/versioning/src/main/kotlin/com/project/starter/versioning/plugins/VersioningPlugin.kt +++ b/versioning/src/main/kotlin/com/project/starter/versioning/plugins/VersioningPlugin.kt @@ -1,6 +1,5 @@ package com.project.starter.versioning.plugins -import com.android.build.api.dsl.ApplicationExtension import com.project.starter.config.getByType import org.gradle.api.DefaultTask import org.gradle.api.GradleException @@ -38,7 +37,7 @@ class VersioningPlugin : Plugin { private fun Project.setupAndroidVersioning(gitVersionProvider: Provider) { pluginManager.withPlugin("com.android.application") { - extensions.getByType().defaultConfig { + extensions.getByType().defaultConfig { val gitVersion = gitVersionProvider.get() val major = gitVersion.major val minor = gitVersion.minor diff --git a/versioning/src/test/kotlin/com/project/starter/versioning/VersioningPluginTest.kt b/versioning/src/test/kotlin/com/project/starter/versioning/VersioningPluginTest.kt index 119bc286..f06fe470 100644 --- a/versioning/src/test/kotlin/com/project/starter/versioning/VersioningPluginTest.kt +++ b/versioning/src/test/kotlin/com/project/starter/versioning/VersioningPluginTest.kt @@ -36,18 +36,18 @@ internal class VersioningPluginTest : WithGradleProjectTest() { writeText( """ plugins { - id 'org.jetbrains.kotlin.jvm' version "1.9.21" + id 'org.jetbrains.kotlin.jvm' } """.trimIndent(), ) } } - module2Root = resolve("module1") { + module2Root = resolve("module2") { resolve("build.gradle") { writeText( """ plugins { - id 'org.jetbrains.kotlin.jvm' version "1.9.21" + id 'org.jetbrains.kotlin.jvm' } """.trimIndent(), )