Skip to content

Commit

Permalink
Kaaveh#123 Move SQLDelight to a dedicated module and update dependencies
Browse files Browse the repository at this point in the history
- Moved SQLDelight `.sq` file to a separate `ComposeNews.data.sqldelight` module.
- Updated dependencies in `build.gradle.kts` and `settings.gradle.kts`.
- Refactored database access logic to ensure modularity and isolation of SQLDelight API.
- Adjusted `MarketDaoImpl.kt` to align with the new structure.
  • Loading branch information
VahidGarousi committed Dec 2, 2024
1 parent 0d43d93 commit da82ade
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 50 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
alias(hilt.android) apply false
alias(kotliner) apply false
alias(detekt) apply false
// alias(ksp) apply false
alias(ksp) apply false
alias(compose) apply false
}
}
Expand Down
13 changes: 1 addition & 12 deletions data/market-local/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.composenews.android.library)
id("composenews.android.hilt")
alias(libs.plugins.sqldelight)
}

android {
Expand All @@ -11,20 +10,10 @@ android {
namespace = "ir.composenews.localdatasource"
}

sqldelight {
databases {
create("MarketDatabase") {
packageName.set("ir.composenews.db")
}
}
}


dependencies {
api(projects.data.sqldelight)
libs.apply {
implementation(sqldelight.android)
implementation(sqldelight.coroutines)
testImplementation(sqldelight.test)
testImplementation(runner)
}
projects.apply {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ir.composenews.localdatasource.database


import app.cash.sqldelight.coroutines.asFlow
import app.cash.sqldelight.coroutines.mapToList
import ir.composenews.db.MarketDatabase
Expand Down
4 changes: 4 additions & 0 deletions data/sqldelight/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
37 changes: 0 additions & 37 deletions settings.gradle

This file was deleted.

38 changes: 38 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
pluginManagement {
includeBuild("build-logic")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "ComposeNews"
include(":library:designsystem")
include(":library:navigation")
include(":konsist")
include(":core:sync")
include(":core:test")
include(":core:base")
include(":core:uimarket")
include(":core:extensions")
include(":core:network:ktor")
include(":domain:market")
include(":data:market-remote")
include(":data:market-local")
include(":data:market-repository")
include(":feature:marketlist")
include(":feature:marketdetail")
include(":app")
include(":app-watch")
include(":app-watch:app")
include(":app-watch:navigation")
include(":app-watch:ui")
include(":data:sqldelight")

0 comments on commit da82ade

Please sign in to comment.