Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Migrate to the Compose gradle plugin #1354

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions Jetsnack/app/build.gradle.kts
Expand Up @@ -18,6 +18,7 @@ plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.compose)
}

android {
Expand Down Expand Up @@ -74,10 +75,6 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}

packaging.resources {
// Multiple dependency bring these files in. Exclude them to enable
// our test APK to build (has no effect on our AARs)
Expand All @@ -86,6 +83,14 @@ android {
}
}

composeCompiler {
// Not required in final Kotlin 2.0.0 release
suppressKotlinVersionCompatibilityCheck = "2.0.0-RC1"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can be removed if Kotlin 2.0.0-RC2 is used

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to use 2.0.0-RC2 results in:

Compose Multiplatform 1.6.2 doesn't support Kotlin 2.0.0-RC2. Please see https://github.com/JetBrains/compose-jb/blob/master/VERSIONING.md#kotlin-compatibility to know the latest supported version of Kotlin.

...where the linked page only references up to 2.0.0-RC1. Appreciate this is very much the bleeding edge of compose but it would be nice if the tables could be kept up-to-date with the RC's.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't control the Jetbrains pages unfortunately. I'm updating this PR now for Kotlin 2.0 though which has been released


// Configure compose compiler options if required
enableExperimentalStrongSkippingMode = true
}

dependencies {
val composeBom = platform(libs.androidx.compose.bom)
implementation(composeBom)
Expand Down
5 changes: 5 additions & 0 deletions Jetsnack/build.gradle.kts
Expand Up @@ -17,6 +17,11 @@
plugins {
alias(libs.plugins.gradle.versions)
alias(libs.plugins.version.catalog.update)

alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.compose) apply false
}

apply("${project.rootDir}/buildscripts/toml-updater-config.gradle")
5 changes: 2 additions & 3 deletions Jetsnack/gradle/libs.versions.toml
Expand Up @@ -27,7 +27,6 @@ androix-test-uiautomator = "2.2.0"
coil = "2.4.0"
# @keep
compileSdk = "34"
compose-compiler = "1.5.4"
coroutines = "1.8.0"
google-maps = "18.2.0"
gradle-versions = "0.51.0"
Expand All @@ -36,8 +35,7 @@ hiltExt = "1.1.0"
# @pin When updating to AGP 7.4.0-alpha10 and up we can update this https://developer.android.com/studio/write/java8-support#library-desugaring-versions
jdkDesugar = "1.2.2"
junit = "4.13.2"
# @pin Update in conjuction with Compose Compiler
kotlin = "1.9.20"
kotlin = "2.0.0-RC1"
kotlinx_immutable = "0.3.5"
ksp = "1.9.20-1.0.14"
maps-compose = "3.1.1"
Expand Down Expand Up @@ -139,6 +137,7 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
secrets = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets" }
version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "version-catalog-update" }