From 759c4172ce680e2ade32631f22a0e92c53270137 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sat, 17 Aug 2024 09:09:06 +0100 Subject: [PATCH 1/5] Kotlin 2.0.10. Signed-off-by: Kenneth J. Shackleton --- build.gradle.kts | 1 + buildSrc/src/main/kotlin/JmhPlugin.kt | 2 +- gradle/libs.versions.toml | 3 ++- selekt-android/build.gradle.kts | 4 ++-- selekt-java/build.gradle.kts | 6 +++--- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 9964025240..36e3862b9e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,6 +40,7 @@ plugins { alias(libs.plugins.ktlint) alias(libs.plugins.ideaExt) alias(libs.plugins.qodana) + alias(libs.plugins.ksp) apply false } repositories { diff --git a/buildSrc/src/main/kotlin/JmhPlugin.kt b/buildSrc/src/main/kotlin/JmhPlugin.kt index dd66ae8dbd..11e126d28e 100644 --- a/buildSrc/src/main/kotlin/JmhPlugin.kt +++ b/buildSrc/src/main/kotlin/JmhPlugin.kt @@ -32,7 +32,7 @@ class JmhPlugin : Plugin { add(name, project) add(name, "org.openjdk.jmh:jmh-core:${Versions.JMH}") } - configurations.getByName("kaptJmh") { + configurations.getByName("kspJmh") { add(name, "org.openjdk.jmh:jmh-generator-annprocess:${Versions.JMH}") } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 43f5166711..eb6410b90e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,7 +27,7 @@ jmh-core = { group = "org.openjdk.jmh", name = "jmh-core", version.ref = "jmh" } jmh-generator-annprocess = { group = "org.openjdk.jmh", name = "jmh-generator-annprocess", version.ref = "jmh" } junit-junit = { group = "junit", name = "junit", version = "4.13.2" } junit-jupiter-params = { group = "org.junit.jupiter", name = "junit-jupiter-params", version = "5.10.2" } -kotlin-bom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version = "1.9.24" } +kotlin-bom = { group = "org.jetbrains.kotlin", name = "kotlin-bom", version = "2.0.10" } kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect" } kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test" } kotlin-test-junit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit" } @@ -46,6 +46,7 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.22.0" } dokka = { id = "org.jetbrains.dokka", version = "1.9.20" } ideaExt = { id = "org.jetbrains.gradle.plugin.idea-ext", version = "1.1.7" } kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.6" } +ksp = { id = "com.google.devtools.ksp", version = "2.0.10-1.0.24" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "11.5.0" } nexus = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" } qodana = { id = "org.jetbrains.qodana", version = "0.1.12" } diff --git a/selekt-android/build.gradle.kts b/selekt-android/build.gradle.kts index a1abea789d..fb7977c8d5 100644 --- a/selekt-android/build.gradle.kts +++ b/selekt-android/build.gradle.kts @@ -22,7 +22,7 @@ plugins { id("kotlin-android") alias(libs.plugins.dokka) alias(libs.plugins.cash.licensee) - kotlin("kapt") + alias(libs.plugins.ksp) `maven-publish` signing alias(libs.plugins.kover) @@ -64,7 +64,7 @@ dependencies { compileOnly(libs.androidx.room.runtime) implementation(projects.selektJava) implementation(projects.selektSqlite3Classes) - kaptTest(libs.androidx.room.compiler) + kspTest(libs.androidx.room.compiler) testImplementation(libs.androidx.lifecycle.livedata.ktx) testImplementation(libs.androidx.room.runtime) testImplementation(libs.androidx.room.ktx) diff --git a/selekt-java/build.gradle.kts b/selekt-java/build.gradle.kts index d24286cef6..96b439814e 100644 --- a/selekt-java/build.gradle.kts +++ b/selekt-java/build.gradle.kts @@ -26,7 +26,7 @@ repositories { plugins { kotlin("jvm") - kotlin("kapt") + alias(libs.plugins.ksp) id("com.android.lint") alias(libs.plugins.kover) alias(libs.plugins.dokka) @@ -101,9 +101,9 @@ tasks.withType().configureEach { } tasks.withType().configureEach { - dependsOn("kaptKotlin") // FIXME Remove? + dependsOn("kspKotlin") // FIXME Remove? } tasks.withType().configureEach { - dependsOn("kaptKotlin") // FIXME Remove? + dependsOn("kspKotlin") // FIXME Remove? } From d57aebd37bcfc581592fd4de782779d026ae34e7 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sat, 17 Aug 2024 09:58:25 +0100 Subject: [PATCH 2/5] Remove JMH plugin from selekt-java until it can be fixed for KSP. Signed-off-by: Kenneth J. Shackleton --- .github/workflows/continuous-integration.yml | 2 +- selekt-java/build.gradle.kts | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 29cee17f24..7c48f4fb2f 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -77,7 +77,7 @@ jobs: ./gradlew :koverVerify -x integrationTest - name: 'Build others' run: | - ./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble jmhClasses + ./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble - name: 'Tear down' if: always() run: | diff --git a/selekt-java/build.gradle.kts b/selekt-java/build.gradle.kts index 96b439814e..f7f6495644 100644 --- a/selekt-java/build.gradle.kts +++ b/selekt-java/build.gradle.kts @@ -32,7 +32,6 @@ plugins { alias(libs.plugins.dokka) `maven-publish` signing - id("bb-jmh") alias(libs.plugins.detekt) alias(libs.plugins.ktlint) } @@ -62,7 +61,6 @@ val integrationTestRuntimeOnly: Configuration by configurations.getting { dependencies { implementation(projects.selektApi) implementation(projects.selektSqlite3Classes) - jmhImplementation(libs.kotlinx.coroutines.core) } publishing { From 9f3989d2ef39245f4e7d65772c39c2e190a92dee Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sat, 17 Aug 2024 11:44:45 +0100 Subject: [PATCH 3/5] Add explicit dependency on selekt-java project from AndroidLibBenchmark project. Signed-off-by: Kenneth J. Shackleton --- AndroidLibBenchmark/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/AndroidLibBenchmark/build.gradle.kts b/AndroidLibBenchmark/build.gradle.kts index 3855c12ca3..53aad0d72e 100644 --- a/AndroidLibBenchmark/build.gradle.kts +++ b/AndroidLibBenchmark/build.gradle.kts @@ -49,6 +49,7 @@ android { dependencies { androidTestImplementation(projects.selektAndroid) + androidTestImplementation(projects.selektJava) androidTestImplementation(libs.androidx.benchmark.junit4) androidTestImplementation(libs.androidx.test.ext) androidTestImplementation(libs.androidx.test.rules) From daa32c4433056d49993defd1c8c1b39b51c26aa9 Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sun, 18 Aug 2024 09:19:06 +0100 Subject: [PATCH 4/5] Check generating KDocs as part of CI. Signed-off-by: Kenneth J. Shackleton --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7c48f4fb2f..6c4ae9ae80 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -77,7 +77,7 @@ jobs: ./gradlew :koverVerify -x integrationTest - name: 'Build others' run: | - ./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble + ./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble dokkaHtml - name: 'Tear down' if: always() run: | From bd84cf155b006a047ba2a9655e8656e5bd643a7c Mon Sep 17 00:00:00 2001 From: "Kenneth J. Shackleton" Date: Sun, 18 Aug 2024 09:24:25 +0100 Subject: [PATCH 5/5] Remove dependency on now non-existent kspKotlin. Signed-off-by: Kenneth J. Shackleton --- selekt-java/build.gradle.kts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/selekt-java/build.gradle.kts b/selekt-java/build.gradle.kts index f7f6495644..137a6c8ec0 100644 --- a/selekt-java/build.gradle.kts +++ b/selekt-java/build.gradle.kts @@ -16,9 +16,6 @@ @file:Suppress("UnstableApiUsage") -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.dokka.gradle.DokkaTaskPartial - repositories { mavenCentral() google() @@ -97,11 +94,3 @@ tasks.register("copyJniLibs") { tasks.withType().configureEach { dependsOn("buildHostSQLite") } - -tasks.withType().configureEach { - dependsOn("kspKotlin") // FIXME Remove? -} - -tasks.withType().configureEach { - dependsOn("kspKotlin") // FIXME Remove? -}