From 0aada8a70569995890c69ae97cf4877b78520d48 Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Tue, 30 Apr 2024 11:35:39 +0200 Subject: [PATCH] Kotlin 2.0.0-RC1 And migrate to the new Compose compiler plugin --- .github/dependabot.yaml | 3 +-- build-logic/build.gradle.kts | 1 + .../com/adevinta/spark/SparkAndroidComposePlugin.kt | 4 +--- build.gradle.kts | 1 + gradle/libs.versions.toml | 8 ++++---- settings.gradle.kts | 9 --------- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index b2deacd00..c434e9354 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -20,12 +20,11 @@ updates: registries: "*" labels: [ ] groups: - kotlin-ksp-compose: + kotlin-ksp: patterns: - "org.jetbrains.kotlin:*" - "org.jetbrains.kotlin.jvm" - "com.google.devtools.ksp" - - "androidx.compose.compiler:compiler" android-build-tools: patterns: - "com.android.tools.build:*" diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts index e608510bb..6767a6618 100644 --- a/build-logic/build.gradle.kts +++ b/build-logic/build.gradle.kts @@ -50,6 +50,7 @@ dependencies { compileOnly(libs.gradlePlugins.android) compileOnly(libs.gradlePlugins.kotlin) compileOnly(libs.gradlePlugins.ksp) + compileOnly(libs.gradlePlugins.compose) compileOnly(libs.gradlePlugins.dependencyGuard) compileOnly(libs.gradlePlugins.dokka) compileOnly(libs.gradlePlugins.spotless) diff --git a/build-logic/src/main/kotlin/com/adevinta/spark/SparkAndroidComposePlugin.kt b/build-logic/src/main/kotlin/com/adevinta/spark/SparkAndroidComposePlugin.kt index 142fd9343..3e732a107 100644 --- a/build-logic/src/main/kotlin/com/adevinta/spark/SparkAndroidComposePlugin.kt +++ b/build-logic/src/main/kotlin/com/adevinta/spark/SparkAndroidComposePlugin.kt @@ -30,13 +30,11 @@ internal class SparkAndroidComposePlugin : Plugin { override fun apply(target: Project) { with(target) { apply(plugin = "org.jetbrains.kotlin.android") + apply(plugin = "org.jetbrains.kotlin.plugin.compose") apply(plugin = "com.adevinta.spark.android") android { buildFeatures.compose = true - composeOptions { - kotlinCompilerExtensionVersion = spark().versions.`androidx-compose-compiler`.toString() - } } dependencies { diff --git a/build.gradle.kts b/build.gradle.kts index f447d6565..cfa93c03f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,7 @@ plugins { alias(libs.plugins.dokka) apply false alias(libs.plugins.dependencyGuard) apply false alias(libs.plugins.spotless) apply false + alias(libs.plugins.compose) apply false id("com.adevinta.spark.root") id("com.adevinta.spark.dokka") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 06f8a1f5f..2d154bc22 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,6 @@ android-gradlePlugin = "8.3.2" androidx-activity = "1.9.0" androidx-appCompat = "1.6.1" androidx-compose-bom = "2024.04.01" -androidx-compose-compiler = "1.5.13-dev-k2.0.0-RC1-50f08dfa4b4" androidx-lifecycle = "2.7.0" androidx-navigation = "2.7.7" androidx-savedstate = "1.2.1" @@ -16,11 +15,11 @@ datastore = "1.1.0" dependencyGuard = "0.5.0" dokka = "1.9.20" junit = "4.13.2" -kotlin = "2.0.0-RC1" +kotlin = "2.0.0-RC2" kotlinx-coroutines = "1.8.0" kotlinx-collections-immutable = "0.3.7" kotlinx-serialization-json = "1.6.3" -ksp = "2.0.0-RC1-1.0.20" +ksp = "2.0.0-RC2-1.0.20" ktlint = "1.2.1" lint = "31.3.2" minCompileSdk = "24" @@ -49,7 +48,6 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver androidx-appCompat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-appCompat" } androidx-appCompat-resources = { module = "androidx.appcompat:appcompat-resources", version.ref = "androidx-appCompat" } androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidx-compose-bom" } -androidx-compose-compiler = { group = "androidx.compose.compiler", name = "compiler", version.ref = "androidx-compose-compiler" } androidx-compose-foundation = { module = "androidx.compose.foundation:foundation" } androidx-compose-foundation-layout = { module = "androidx.compose.foundation:foundation-layout" } androidx-compose-material-iconsExtended = { module = "androidx.compose.material:material-icons-extended" } @@ -88,6 +86,7 @@ dokka-android-documentation-plugin = { module = "org.jetbrains.dokka:android-doc dokka-base = { module = "org.jetbrains.dokka:dokka-base", version.ref = "dokka" } gradlePlugins-android = { module = "com.android.tools.build:gradle", version.ref = "android-gradlePlugin" } +gradlePlugins-compose = { module = "org.jetbrains.kotlin:compose-compiler-gradle-plugin", version.ref = "kotlin" } gradlePlugins-dependencyGuard = { module = "com.dropbox.dependency-guard:com.dropbox.dependency-guard.gradle.plugin", version.ref = "dependencyGuard" } gradlePlugins-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } gradlePlugins-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } @@ -126,6 +125,7 @@ android-kotlin = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android-library = { id = "com.android.library", version.ref = "android-gradlePlugin" } android-lint = { id = "com.android.lint", version.ref = "android-gradlePlugin" } android-test = { id = "com.android.test", version.ref = "android-gradlePlugin" } +compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } paparazzi = { id = "app.cash.paparazzi", version.ref = "paparazzi" } dependencyGuard = { id = "com.dropbox.dependency-guard", version.ref = "dependencyGuard" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } diff --git a/settings.gradle.kts b/settings.gradle.kts index d1cd8c643..5f1db1d7b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,15 +33,6 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - - // Pre-release artifacts of compose-compiler - // https://androidx.dev/storage/compose-compiler/repository - maven("https://androidx.dev/storage/compose-compiler/repository/") { - name = "compose-compiler-dev" - content { - includeGroup("androidx.compose.compiler") - } - } } }