Skip to content

Commit

Permalink
Migrate to kotlin compose compiler bom
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintPatrck committed Jun 14, 2024
1 parent 33674ed commit 6fc8a50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ local.properties
# Fastlane
fastlane/report.xml
fastlane/README.md
/.kotlin/
14 changes: 8 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import com.google.protobuf.gradle.proto
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.crashlytics)
alias(libs.plugins.hilt)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose.compiler)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlinx.kover)
Expand Down Expand Up @@ -53,16 +55,10 @@ android {
sourceCompatibility(libs.versions.jvmTarget.get())
targetCompatibility(libs.versions.jvmTarget.get())
}
kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.kotlinCompilerExtensionVersion.get()
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1,LICENSE*.md}"
Expand All @@ -77,6 +73,12 @@ android {
}
}

kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(libs.versions.jvmTarget.get()))
}
}

dependencies {

implementation(libs.androidx.activity.compose)
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
alias(libs.plugins.google.services) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose.compiler) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlinx.kover) apply false
alias(libs.plugins.ksp) apply false
Expand Down
7 changes: 1 addition & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ googleServices = "4.4.1"
hilt = "2.51.1"
junit5 = "5.10.2"
jvmTarget = "17"
# kotlin and kotlinCompileExtensions **must** use compatible versions. Do not update either without
# first checking the Compose to Kotlin Compatibility Map.
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin
kotlin = "2.0.0"
kotlinCompilerExtensionVersion = "1.5.14"
kotlinxCollectionsImmutable = "0.3.7"
kotlinxCoroutines = "1.8.1"
kotlinxSerialization = "1.6.3"
Expand All @@ -70,8 +66,6 @@ androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycl
androidx-camera-view = { module = "androidx.camera:camera-view", version.ref = "androidxCamera" }
androidx-compose-animation = { module = "androidx.compose.animation:animation" }
androidx-compose-bom = { module = "androidx.compose:compose-bom", version.ref = "androidxComposeBom" }
# Included so that Renovate tracks updates since Compose Compiler is not referenced directly in `dependency {}` blocks.
androidx-compose-compiler = { module = "androidx.compose.compiler:compiler", version.ref = "kotlinCompilerExtensionVersion" }
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-runtime = { module = "androidx.compose.runtime:runtime" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
Expand Down Expand Up @@ -132,6 +126,7 @@ google-protobuf = { id = "com.google.protobuf", version.ref = "googleProtoBufPlu
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinx-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kotlinxKover" }
Expand Down

0 comments on commit 6fc8a50

Please sign in to comment.