Skip to content

Commit

Permalink
chore(deps): update kotlin & compose to v2 (major) (#993)
Browse files Browse the repository at this point in the history
* chore(deps): update kotlin & compose to v2

* Resolve parcelable issue with k2 compiler

* Use release kotlin compose plugin version

---------

Co-authored-by: playground-manager[bot] <126197455+playground-manager[bot]@users.noreply.github.com>
Co-authored-by: Ashley Davies <[email protected]>
Co-authored-by: Ash Davies <[email protected]>
  • Loading branch information
3 people authored May 26, 2024
1 parent fda5d9a commit 8dcdc6c
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 36 deletions.
4 changes: 1 addition & 3 deletions app-launcher/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ buildConfig {
}

kotlin {
jvm {
withJava()
}
jvm()

sourceSets {
commonMain.dependencies {
Expand Down
3 changes: 2 additions & 1 deletion build-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ dependencies {

with(libs.plugins) {
implementation(plugin(android.library))
implementation(plugin(compose.compiler))
implementation(plugin(detekt))
implementation(plugin(kotlin.compose))
implementation(plugin(jetbrains.compose))
implementation(plugin(kotlin.multiplatform))
implementation(plugin(kotlin.serialization))
implementation(plugin(ktlint))
Expand Down
7 changes: 2 additions & 5 deletions build-plugins/src/main/kotlin/io.ashdavies.compose.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
plugins {
id("org.jetbrains.compose")
kotlin("multiplatform")
}
id("org.jetbrains.kotlin.plugin.compose")

compose {
val composeCompiler = libs.compose.compiler.get()
kotlinCompilerPlugin.set("$composeCompiler")
kotlin("multiplatform")
}

kotlin {
Expand Down
15 changes: 14 additions & 1 deletion build-plugins/src/main/kotlin/io.ashdavies.parcelable.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.gradle.kotlin.dsl.kotlin
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

pluginManager.withPlugin("com.android.library") {
plugins { id("kotlin-parcelize") }
Expand All @@ -9,7 +9,20 @@ plugins {
}

kotlin {
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class) compilerOptions {
val additionalAnnotation = "org.jetbrains.kotlin.parcelize:additionalAnnotation"
val parcelizeAnnotation = "io.ashdavies.parcelable.Parcelize"

freeCompilerArgs.addParameter("plugin:$additionalAnnotation=$parcelizeAnnotation")
}
}

sourceSets.commonMain.dependencies {
implementation(project(":parcelable-support"))
}
}

private fun ListProperty<String>.addParameter(value: String) {
addAll("-P", value)
}
11 changes: 2 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ plugins {
classpath(android.library)
classpath(apollo.graphql)
classpath(cash.sqldelight)
classpath(compose.compiler)
classpath(detekt)
classpath(google.services)
classpath(kotlin.compose)
classpath(jetbrains.compose)
classpath(kotlin.multiplatform)
classpath(kotlin.serialization)
classpath(ktlint)
Expand All @@ -26,14 +27,6 @@ plugins {
}
}

dependencyAnalysis {
structure {
bundle("compose-runtime") {
includeGroup(libs.compose.runtime)
}
}
}

doctor {
allowBuildingAllAndroidAppsSimultaneously.set(true)
disallowCleanTaskDependencies.set(false)
Expand Down
11 changes: 4 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ androidx-paging = "3.3.0"
apollo-graphql = "2.5.14"
cash-sqldelight = "2.0.2"
coil-kt = "3.0.0-alpha06"
compose-compiler = "1.5.10.2"
compose-plugin = "1.6.10"
gitlive-firebase = "1.12.0"
google-accompanist = "0.34.0"
google-android = "8.4.1"
google-maps-compose = "4.3.2"
google-services = "4.4.1"
jetbrains-compose = "1.6.2"
jetbrains-kotlin = "1.9.23"
jetbrains-kotlin = "2.0.0"
kotlin-jvmTarget = "17"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.6.3"
Expand Down Expand Up @@ -41,9 +40,6 @@ auth-jwks-rsa = "com.auth0:jwks-rsa:0.22.1"
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil-kt" }
coil-network = { module = "io.coil-kt.coil3:coil-network-ktor", version.ref = "coil-kt" }

compose-compiler = { module = "org.jetbrains.compose.compiler:compiler", version.ref = "compose-compiler" }
compose-runtime = { module = "org.jetbrains.compose.runtime:runtime", version.ref = "jetbrains-compose" }

fasterxml-jackson-core = "com.fasterxml.jackson.core:jackson-core:2.17.1"
fusesource-jansi = "org.fusesource.jansi:jansi:2.4.1"

Expand Down Expand Up @@ -127,11 +123,12 @@ android-library = { id = "com.android.library", version.ref = "google-android" }
apollo-graphql = { id = "com.apollographql.apollo", version.ref = "apollo-graphql" }
build-config = "com.github.gmazzo.buildconfig:5.3.5"
cash-sqldelight = { id = "app.cash.sqldelight", version.ref = "cash-sqldelight" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "jetbrains-kotlin" }
dependency-analysis = "com.autonomousapps.dependency-analysis:1.32.0"
detekt = "io.gitlab.arturbosch.detekt:1.23.6"
google-services = { id = "com.google.gms.google-services", version.ref = "google-services" }
gradle-doctor = "com.osacky.doctor:0.10.0"
kotlin-compose = { id = "org.jetbrains.compose", version.ref = "jetbrains-compose" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "jetbrains-kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "jetbrains-kotlin" }
kotlinx-kover = "org.jetbrains.kotlinx.kover:0.8.0"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package io.ashdavies.parcelable

@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.BINARY)
public expect annotation class Parcelize()
@Retention(AnnotationRetention.SOURCE)
public annotation class Parcelize

This file was deleted.

0 comments on commit 8dcdc6c

Please sign in to comment.