Skip to content

Commit

Permalink
refactor: migrate Compose to Compose Multiplatform.
Browse files Browse the repository at this point in the history
  • Loading branch information
GerardPaligot committed Mar 9, 2024
1 parent 340d60e commit fe53e4d
Show file tree
Hide file tree
Showing 30 changed files with 104 additions and 135 deletions.
2 changes: 1 addition & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ dependencies {

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3.windowsizeclass)
implementation(libs.androidx.compose.ui)
implementation(compose.ui)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.profile)
Expand Down
1 change: 1 addition & 0 deletions build-logic/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ repositories {
dependencies {
implementation(gradleApi())
implementation(libs.android.gradlePlugin)
implementation(libs.jetbrains.compose.gradlePlugin)
implementation(libs.jetbrains.kotlin.gradlePlugin)
implementation(libs.ktlint.gradlePlugin)
implementation(libs.detekt.gradlePlugin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import extensions.configureAndroidCompose
import extensions.configureDesugaring
import extensions.configureKotlinAndroid
import org.gradle.api.Plugin
Expand All @@ -16,14 +15,14 @@ class AndroidApplicationPlugin: Plugin<Project> {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("org.jetbrains.compose")
apply("kotlin-parcelize")
apply("com.google.gms.google-services")
apply("com.google.firebase.crashlytics")
}
extensions.configure<BaseAppModuleExtension> {
configureKotlinAndroid(this)
configureDesugaring(this)
configureAndroidCompose(this)
defaultConfig.targetSdk = 34
}
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

import com.android.build.gradle.LibraryExtension
import extensions.configureAndroidCompose
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType

Expand All @@ -13,9 +10,7 @@ class AndroidLibraryComposePlugin: Plugin<Project> {
with(target) {
with(pluginManager) {
apply("com.android.library")
}
extensions.configure<LibraryExtension> {
configureAndroidCompose(this)
apply("org.jetbrains.compose")
}
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
Expand Down
28 changes: 0 additions & 28 deletions build-logic/plugins/src/main/kotlin/extensions/ComposeAndroid.kt

This file was deleted.

13 changes: 5 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ google-material = "1.11.0"
google-mlkit-barcode-scanning = "17.2.0"
google-services = "4.3.15"
google-zxing = "3.5.1"
jetbrains-compose = "1.6.0"
jetbrains-kotlin = "1.9.22"
jetbrains-kotlinx-collections = "0.3.6"
jetbrains-kotlinx-coroutines = "1.7.3"
Expand All @@ -52,17 +53,12 @@ androidx-camera-camera2 = { group = "androidx.camera", name = "camera-camera2",
androidx-camera-lifecycle = { group = "androidx.camera", name = "camera-lifecycle", version.ref = "androidx-camera" }
androidx-camera-view = { group = "androidx.camera", name = "camera-view", version.ref = "androidx-camera" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidx-compose-bom" }
androidx-compose-foundation-layout = { group = "androidx.compose.foundation", name = "foundation-layout" }
androidx-compose-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
androidx-compose-lifecycle = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
androidx-compose-material3-windowsizeclass = { group = "androidx.compose.material3", name = "material3-window-size-class" }
androidx-compose-material3-adaptive = { group = "androidx.compose.material3", name = "material3-adaptive", version = "1.0.0-alpha04" }
androidx-compose-material3-adaptive-navigation-suite = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite", version = "1.0.0-alpha02" }
androidx-compose-runtime = { group = "androidx.compose.runtime", name = "runtime-livedata" }
androidx-compose-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-lifecycle-viewmodel = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-compose-runtime-livedata = { group = "androidx.compose.runtime", name = "runtime-livedata" }
androidx-lifecycle-viewmodel-ktx = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidx-navigation-compose" }
androidx-profile = { group = "androidx.profileinstaller", name = "profileinstaller", version.ref = "androidx-profile" }
androidx-workmanager-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "androidx-work" }
Expand All @@ -85,6 +81,7 @@ detekt-gradlePlugin = { group = "io.gitlab.arturbosch.detekt", name = "detekt-gr

font-awesome = { group = "br.com.devsrsouza.compose.icons.android", name = "font-awesome", version.ref = "font-awesome" }

jetbrains-compose-gradlePlugin = { group = "org.jetbrains.compose", name = "compose-gradle-plugin", version.ref = "jetbrains-compose" }
jetbrains-kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "jetbrains-kotlin" }
jetbrains-kotlin-serialization-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-serialization", version.ref = "jetbrains-kotlin" }
jetbrains-kotlinx-collections = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "jetbrains-kotlinx-collections" }
Expand Down
10 changes: 5 additions & 5 deletions theme-m3/event-list/event-list-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

implementation(platform(libs.google.firebase.bom))
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand Down
6 changes: 3 additions & 3 deletions theme-m3/event-list/event-list-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ dependencies {
implementation(projects.shared.uiModels)
implementation(projects.themeM3.style.theme)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)

implementation(libs.jetbrains.kotlinx.collections)
}
10 changes: 5 additions & 5 deletions theme-m3/infos/infos-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.richtext.commonmark)

implementation(platform(libs.google.firebase.bom))
Expand Down
8 changes: 4 additions & 4 deletions theme-m3/infos/infos-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.icons)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(compose.materialIconsExtended)
implementation(libs.richtext.commonmark)
}
9 changes: 5 additions & 4 deletions theme-m3/main/main/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ dependencies {
implementation(libs.koin.androidx.compose)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.windowsizeclass)
implementation(libs.androidx.compose.material3.adaptive)
implementation(libs.androidx.compose.material3.adaptive.navigation.suite)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.compose.runtime.livedata)
implementation(compose.preview)
implementation(compose.material3)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.navigation.compose)

implementation(libs.jetbrains.kotlinx.collections)
Expand Down
3 changes: 2 additions & 1 deletion theme-m3/navigation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("conferences4hall.android.library")
id("conferences4hall.android.library.compose")
id("conferences4hall.quality")
}

Expand All @@ -11,5 +12,5 @@ dependencies {
implementation(projects.themeM3.style.theme)

implementation(libs.androidx.annotation)
implementation(libs.androidx.compose.icons)
implementation(compose.materialIconsExtended)
}
10 changes: 5 additions & 5 deletions theme-m3/networking/networking-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

implementation(platform(libs.google.firebase.bom))
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand Down
6 changes: 3 additions & 3 deletions theme-m3/networking/networking-screens/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
}
8 changes: 4 additions & 4 deletions theme-m3/networking/networking-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.icons)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(compose.materialIconsExtended)
}
9 changes: 5 additions & 4 deletions theme-m3/partners/partners-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ dependencies {
implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.adaptive)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.preview)
implementation(compose.material3)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

implementation(platform(libs.google.firebase.bom))
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand Down
6 changes: 3 additions & 3 deletions theme-m3/partners/partners-screens/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
}
8 changes: 4 additions & 4 deletions theme-m3/partners/partners-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.icons)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(compose.materialIconsExtended)

implementation(libs.coil.compose)
}
9 changes: 5 additions & 4 deletions theme-m3/schedules/schedules-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ dependencies {
implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.adaptive)
implementation(libs.androidx.compose.material3.adaptive.navigation.suite)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.preview)
implementation(compose.material3)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

implementation(platform(libs.google.firebase.bom))
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand Down
6 changes: 3 additions & 3 deletions theme-m3/schedules/schedules-screens/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
}
9 changes: 5 additions & 4 deletions theme-m3/schedules/schedules-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.icons)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(compose.materialIconsExtended)

implementation(libs.richtext.commonmark)
api(libs.openfeedback.m3)
}
9 changes: 5 additions & 4 deletions theme-m3/speakers/speakers-feature/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ dependencies {
implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.material3.adaptive)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.lifecycle)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(compose.preview)
implementation(compose.material3)
debugImplementation(compose.uiTooling)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.androidx.lifecycle.viewmodel.ktx)

implementation(platform(libs.google.firebase.bom))
implementation("com.google.firebase:firebase-crashlytics-ktx")
Expand Down
6 changes: 3 additions & 3 deletions theme-m3/speakers/speakers-screens/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies {

implementation(libs.jetbrains.kotlinx.collections)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
}
8 changes: 4 additions & 4 deletions theme-m3/speakers/speakers-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ dependencies {
implementation(projects.themeM3.style.speakers)
implementation(projects.themeM3.style.theme)

implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.compose.tooling)
implementation(libs.androidx.compose.icons)
implementation(compose.material3)
implementation(compose.preview)
debugImplementation(compose.uiTooling)
implementation(compose.materialIconsExtended)

implementation(libs.coil.compose)

Expand Down
Loading

0 comments on commit fe53e4d

Please sign in to comment.