Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ plugins {
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.kotlin.multiplatform).apply(false)
alias(libs.plugins.kotlinter).apply(false)
alias(libs.plugins.room).apply(false)
}

apply(from = "buildscripts/githooks.gradle")
Expand Down
17 changes: 17 additions & 0 deletions buildscripts/setup.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ def tasksToExclude = [
"generateResourceAccessors",
"generateServiceApolloSources",
"prepareComposeResourcesTask",
"extractDeepLinksDebug",
"generateDebug",
"generateRelease",
"compileDebug",
"compileRelease",
"checkDebug",
"checkRelease",
"processDebug",
"processRelease",
"packageDebug",
"packageRelease",
"parseDebug",
"parseRelease",
"mergeDebug",
"mergeRelease",
"mapDebug",
"mapRelease",
]

project('shared').tasks.named { taskName ->
Expand Down
7 changes: 6 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ leakCanary = "2.14"
material = "1.13.0"
material3Adaptive = "1.2.0"
minSdk = "23"
room = "2.8.4"
sqldelight = "2.2.1"
testParameterInjector = "1.20"

Expand All @@ -33,6 +34,9 @@ androidx-activity-compose = { module = "androidx.activity:activity-compose", ver
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" }
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidxLifecycle" }
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidxLifecycle" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-room-runtime-android = { module = "androidx.room:room-runtime-android", version.ref = "room" }
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso" }
androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidxTest" }
apollo-runtime = { module = "com.apollographql.apollo:apollo-runtime", version.ref = "apollo" }
Expand Down Expand Up @@ -75,4 +79,5 @@ kotlin-compose = { id = "org.jetbrains.compose", version.ref = "kmpCompose" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinter = { id = "org.jmailen.kotlinter", version.ref = "kotlinter" }
parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
room = { id = "androidx.room", version.ref = "room" }
20 changes: 20 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ plugins {
alias(libs.plugins.apollo.graphql)
alias(libs.plugins.cash.sqldelight)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.google.devtools.ksp)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlinx.serialization)
alias(libs.plugins.room)
}

kotlin {
Expand All @@ -36,6 +38,10 @@ kotlin {
jvm("desktop")

sourceSets {
androidMain.dependencies {
implementation(libs.androidx.room.runtime.android)
}

commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
Expand All @@ -46,6 +52,7 @@ kotlin {
implementation(libs.androidx.datastore.preferences)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.room.runtime)
implementation(libs.apollo.runtime)
implementation(libs.cash.sqldelight.coroutines)
implementation(libs.cash.sqldelight.runtime)
Expand Down Expand Up @@ -119,6 +126,19 @@ android {
namespace = "template.shared"
}

dependencies {
// KSP configuration for Room code generation
add("kspCommonMainMetadata", libs.androidx.room.compiler)
add("kspAndroid", libs.androidx.room.compiler)
add("kspIosX64", libs.androidx.room.compiler)
add("kspIosArm64", libs.androidx.room.compiler)
add("kspIosSimulatorArm64", libs.androidx.room.compiler)
}

room {
schemaDirectory("$projectDir/schemas")
}

sqldelight {
databases {
create("AppDatabase") {
Expand Down
Loading