Skip to content

Commit 6dbef49

Browse files
authored
Split domain (#65)
* create module * create module * refactor: split :domain * fix: add domain/AndroidManifest.xml * gradle cache * update ComicDetailViewModel.kt * refactor(domain): use Uri multiplatform * remove domain manifest
1 parent 989abe0 commit 6dbef49

39 files changed

+175
-72
lines changed

.github/workflows/build-release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ jobs:
1616
distribution: 'zulu'
1717
java-version: '11'
1818

19+
- name: Cache gradle, wrapper and buildSrc
20+
uses: actions/cache@v2
21+
with:
22+
path: |
23+
~/.gradle/caches
24+
~/.gradle/wrapper
25+
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
26+
restore-keys: |
27+
${{ runner.os }}-${{ github.job }}-
28+
1929
- name: Make gradlew executable
2030
run: chmod +x ./gradlew
2131

.github/workflows/build.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,32 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: Set up JDK
16-
uses: actions/setup-java@v3
17-
with:
18-
distribution: 'zulu'
19-
java-version: '11'
20-
21-
- name: Make gradlew executable
22-
run: chmod +x ./gradlew
23-
24-
- name: Build debug APK
25-
run: ./gradlew assembleDebug --warning-mode all --stacktrace
26-
27-
- name: Upload APK
28-
uses: actions/upload-artifact@v3
29-
with:
30-
name: app-debug
31-
path: app/build/outputs/apk/debug/app-debug.apk
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up JDK
16+
uses: actions/setup-java@v3
17+
with:
18+
distribution: 'zulu'
19+
java-version: '11'
20+
21+
- name: Cache gradle, wrapper and buildSrc
22+
uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
28+
restore-keys: |
29+
${{ runner.os }}-${{ github.job }}-
30+
31+
- name: Make gradlew executable
32+
run: chmod +x ./gradlew
33+
34+
- name: Build debug APK
35+
run: ./gradlew assembleDebug --warning-mode all --stacktrace
36+
37+
- name: Upload APK
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: app-debug
41+
path: app/build/outputs/apk/debug/app-debug.apk

.github/workflows/spotless.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ jobs:
1818
distribution: 'zulu'
1919
java-version: '11'
2020

21+
- name: Cache gradle, wrapper and buildSrc
22+
uses: actions/cache@v2
23+
with:
24+
path: |
25+
~/.gradle/caches
26+
~/.gradle/wrapper
27+
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}-${{ hashFiles('**/buildSrc/**/*.kt') }}
28+
restore-keys: |
29+
${{ runner.os }}-${{ github.job }}-
30+
2131
- name: Make gradlew executable
2232
run: chmod +x ./gradlew
2333

.idea/compiler.xml

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/jarRepositories.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dependencies {
1414
implementation(project(deps.module.baseUi))
1515
implementation(project(deps.module.utils))
1616
implementation(project(deps.module.navigation))
17+
implementation(project(deps.module.domain))
1718

1819
implementation(deps.kotlin.stdlib)
1920
val coroutineDepConfig: (ExternalModuleDependency).() -> Unit = {

app/src/main/java/com/hoc/comicapp/data/local/dao/ChapterDao.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.hoc.comicapp.data.local.dao
22

3-
import androidx.lifecycle.LiveData
43
import androidx.room.Dao
54
import androidx.room.Delete
65
import androidx.room.Insert
@@ -21,9 +20,6 @@ abstract class ChapterDao {
2120
@Query("SELECT COUNT(*) FROM downloaded_chapters WHERE comic_link = :comicLink")
2221
abstract suspend fun getCountByComicLink(comicLink: String): List<Int>
2322

24-
@Query("SELECT * FROM downloaded_chapters")
25-
abstract fun getAllChaptersLiveData(): LiveData<List<ChapterEntity>>
26-
2723
@Query("SELECT * FROM downloaded_chapters")
2824
abstract fun getAllChaptersFlow(): Flow<List<ChapterEntity>>
2925

app/src/main/java/com/hoc/comicapp/data/repository/DownloadComicsRepositoryImpl.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.hoc.comicapp.data.repository
22

33
import android.app.Application
4-
import androidx.lifecycle.LiveData
54
import androidx.lifecycle.map
65
import androidx.room.withTransaction
76
import androidx.work.Constraints
@@ -77,9 +76,9 @@ class DownloadComicsRepositoryImpl(
7776
private val analyticsService: AnalyticsService,
7877
) : DownloadComicsRepository {
7978

80-
override fun getDownloadedChapters(): LiveData<List<DownloadedChapter>> =
79+
override fun getDownloadedChapters(): Flow<List<DownloadedChapter>> =
8180
chapterDao
82-
.getAllChaptersLiveData()
81+
.getAllChaptersFlow()
8382
.map { it.map(Mappers::entityToDomainModel) }
8483

8584
override fun getDownloadedComics(): Observable<DomainResult<List<DownloadedComic>>> =

0 commit comments

Comments
 (0)