From 00fa208dc3eb1b0ef310d2768528c8f2a01487ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 22:03:26 +0000 Subject: [PATCH 1/3] Update kotlin monorepo to v2.1.0 --- 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 61d9645..ecfc017 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ binaryCompatibilityValidator = "0.16.3" detekt = "1.23.7" diffUtils = "4.15" junit = "5.11.4" -kotlin = "2.0.21" +kotlin = "2.1.0" ktfmt-plugin = "0.21.0" ktfmt = "0.53" pluginPublish = "1.3.0" From aa7395794b150b30a45c889387b69f365ef29ef8 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Sat, 7 Dec 2024 22:08:53 +0000 Subject: [PATCH 2/3] Make the project compile --- .gitignore | 3 ++- README.md | 2 -- example/build.gradle.kts | 2 +- plugin-build/plugin/build.gradle.kts | 4 ++-- .../java/com/ncorti/ktfmt/gradle/KtfmtPluginUtils.kt | 10 ++-------- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 291ebc6..d1942d0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ /local.properties .DS_Store /build -.idea/ \ No newline at end of file +.idea/ +.kotlin/ diff --git a/README.md b/README.md index ff99bb6..3108fbc 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,6 @@ Please note that `ktfmt-gradle` relies on `ktfmt` hence the minimum supported JD Please also note the following requirements: -* **Kotlin 1.4+**. In order to reformat Kotlin 1.4 code, you need run on **Gradle to 6.8+** (This is due to Gradle 6.7 embedding Kotlin 1.3.x - See [#12660](https://github.com/gradle/gradle/issues/12660)). - * **Android**. `ktfmt-gradle` relies on features from **Android Gradle Plugin 4.1+**. So make sure you bump AGP before applying this plugin. ### Task diff --git a/example/build.gradle.kts b/example/build.gradle.kts index 596d3d5..99a0d72 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -3,7 +3,7 @@ import app.cash.sqldelight.gradle.VerifyMigrationTask plugins { kotlin("jvm") id("com.ncorti.ktfmt.gradle") - id("com.google.devtools.ksp") version "2.0.21-1.0.27" + id("com.google.devtools.ksp") version "2.1.0-1.0.29" id("app.cash.sqldelight") version "2.0.2" } diff --git a/plugin-build/plugin/build.gradle.kts b/plugin-build/plugin/build.gradle.kts index 3ba7181..1e3e7f4 100644 --- a/plugin-build/plugin/build.gradle.kts +++ b/plugin-build/plugin/build.gradle.kts @@ -15,8 +15,8 @@ java { kotlin { compilerOptions { - apiVersion.set(KotlinVersion.fromVersion("1.4")) - languageVersion.set(KotlinVersion.fromVersion("1.4")) + apiVersion.set(KotlinVersion.fromVersion("1.6")) + languageVersion.set(KotlinVersion.fromVersion("1.6")) jvmTarget = JvmTarget.JVM_11 } } diff --git a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/KtfmtPluginUtils.kt b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/KtfmtPluginUtils.kt index b09d464..4f515a5 100644 --- a/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/KtfmtPluginUtils.kt +++ b/plugin-build/plugin/src/main/java/com/ncorti/ktfmt/gradle/KtfmtPluginUtils.kt @@ -116,10 +116,7 @@ internal object KtfmtPluginUtils { name.split(" ").joinToString("") { val charArray = it.toCharArray() if (charArray[0].isLowerCase()) { - // We use toUpperCase here to retain compatibility with Gradle 6.9 and Kotlin - // 1.4 - @Suppress("DEPRECATION") - charArray[0] = charArray[0].toUpperCase() + charArray[0] = charArray[0].uppercaseChar() } charArray.concatToString() } @@ -144,10 +141,7 @@ internal object KtfmtPluginUtils { name.split(" ").joinToString("") { val charArray = it.toCharArray() if (charArray[0].isLowerCase()) { - // We use toUpperCase here to retain compatibility with Gradle 6.9 and Kotlin - // 1.4 - @Suppress("DEPRECATION") - charArray[0] = charArray[0].toUpperCase() + charArray[0] = charArray[0].uppercaseChar() } charArray.concatToString() } From 33c6239d6c61ebbebabb99d52ec5287444f57efa Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 24 Dec 2024 23:10:44 +0100 Subject: [PATCH 3/3] Gradle to 8.12 --- .idea/gradle.xml | 2 +- CHANGELOG.md | 2 ++ gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- plugin-build/gradle/wrapper/gradle-wrapper.properties | 2 +- plugin-build/gradlew | 3 +-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 92cb051..ac9dfeb 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -16,12 +16,12 @@ -