Skip to content

Commit

Permalink
For touchlab#305 - Add support for Compose Multiplatform support
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugurell committed Jul 21, 2023
1 parent 0c175a8 commit 0ee5d17
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("com.android.application")
id("org.jetbrains.compose")
kotlin("android")
}

Expand Down Expand Up @@ -39,6 +40,13 @@ android {
}
}

// Using Compose gradle plugin v 1.4.1 which supports at most Kotlin 1.8.1
// And SQLDelight 2.0+ which supports at least Kotlin 1.8.2
// Quick workaround until we get some easier to match versions.
compose {
kotlinCompilerPlugin.set("org.jetbrains.compose.compiler:compiler:1.4.8")
}

dependencies {
implementation(project(":shared"))
implementation(libs.bundles.app.ui)
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
kotlin("plugin.serialization") version libs.versions.kotlin.get() apply false
id("app.cash.sqldelight") version libs.versions.sqlDelight.get() apply false
id("com.android.library") version libs.versions.android.gradle.plugin.get() apply false
id("org.jetbrains.compose") version libs.versions.compose.gradle.plugin.get() apply(false)
}

allprojects {
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ kotlin.code.style=official
xcodeproj=./ios
# New Android source-set layout
kotlin.mpp.androidSourceSetLayoutVersion=2

# Compose Multiplatform
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
kotlin = "1.8.21"
kotlin = "1.8.22"

## SDK Versions
minSdk = "21"
Expand All @@ -8,11 +8,12 @@ compileSdk = "33"

# Dependencies
android-gradle-plugin = "7.4.2"
compose-gradle-plugin = "1.4.1"
ktlint-gradle = "11.4.2"
gradle-versions = "0.47.0"

compose = "1.4.3"
composeCompiler = "1.4.7"
composeCompiler = "1.4.8"

android-desugaring = "2.0.3"
androidx-core = "1.10.1"
Expand Down
10 changes: 10 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
kotlin("native.cocoapods")
kotlin("plugin.serialization")
id("com.android.library")
id("org.jetbrains.compose")
id("app.cash.sqldelight")
}

Expand Down Expand Up @@ -46,6 +47,7 @@ kotlin {

val commonMain by getting {
dependencies {
implementation(compose.runtime)
implementation(libs.koin.core)
implementation(libs.coroutines.core)
implementation(libs.sqlDelight.coroutinesExt)
Expand All @@ -62,6 +64,7 @@ kotlin {
}
val androidMain by getting {
dependencies {
implementation(libs.compose.activity)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.sqlDelight.android)
implementation(libs.ktor.client.okHttp)
Expand Down Expand Up @@ -106,6 +109,13 @@ kotlin {
}
}

// Using Compose gradle plugin v 1.4.1 which supports at most Kotlin 1.8.1
// And SQLDelight 2.0+ which supports at least Kotlin 1.8.2
// Quick workaround until we get some easier to match versions.
compose {
kotlinCompilerPlugin.set("org.jetbrains.compose.compiler:compiler:1.4.8")
}

sqldelight {
databases.create("KaMPKitDb") {
packageName.set("co.touchlab.kampkit.db")
Expand Down

0 comments on commit 0ee5d17

Please sign in to comment.