diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index 5432d0db..6948d4e2 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -38,7 +38,12 @@ jobs:
run: chmod +x ./gradlew
- name: Run Android Debug Unit Test
- run: ./gradlew :app:koverXmlReport --warning-mode all --stacktrace
+ run: ./gradlew app:koverXmlReportDebug --warning-mode all --stacktrace
- name: Upload Test Report
- uses: codecov/codecov-action@v4.4.0
+ uses: codecov/codecov-action@v4.5.0
+ with:
+ files: ./app/build/reports/kover/reportDebug.xml
+ fail_ci_if_error: true
+ token: ${{ secrets.CODECOV_TOKEN }}
+ verbose: true
diff --git a/.gitignore b/.gitignore
index b10b0d06..523fac1d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,5 @@
.cxx
local.properties
**/build/
+# Since Kotlin 2.0.0, .kotlin directory is created at compile time
+.kotlin
diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml
new file mode 100644
index 00000000..371f2e29
--- /dev/null
+++ b/.idea/appInsightsSettings.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
new file mode 100644
index 00000000..b268ef36
--- /dev/null
+++ b/.idea/deploymentTargetSelector.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 9561532f..c613c422 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -4,10 +4,19 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -25,6 +34,7 @@
+
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index e6e4991d..d4b7accb 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,10 +1,6 @@
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/migrations.xml b/.idea/migrations.xml
new file mode 100644
index 00000000..f8051a6f
--- /dev/null
+++ b/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 0f4ea7c0..3be503ca 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,3 +1,4 @@
+
@@ -21,7 +22,7 @@
-
+
diff --git a/.idea/other.xml b/.idea/other.xml
new file mode 100644
index 00000000..1b1a2c59
--- /dev/null
+++ b/.idea/other.xml
@@ -0,0 +1,296 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 4c6280eb..7ddfc9ed 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index a86b0e04..7ebc2db1 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@
[](https://github.com/Kotlin-Android-Open-Source/MVI-Coroutines-Flow/actions/workflows/qodana.yml)
[](https://github.com/Kotlin-Android-Open-Source/MVI-Coroutines-Flow/actions/workflows/gradle-wrapper-validation.yml)
[](https://android-arsenal.com/api?level=21)
-[](http://kotlinlang.org)
+[](http://kotlinlang.org)
[](https://hits.seeyoufarm.com)
[](https://opensource.org/licenses/MIT)
[](https://gitter.im/Kotlin-Android-Open-Source/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index cb704ca4..2100bd6b 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -106,20 +106,16 @@ dependencies {
kover(project(":mvi-base"))
}
-koverReport {
- // filters for all report types of all build variants
- filters {
- excludes {
- classes(
- "*.databinding.*",
- "*.BuildConfig",
- )
+kover {
+ reports {
+ // filters for all report types of all build variants
+ filters {
+ excludes {
+ classes(
+ "*.databinding.*",
+ "*.BuildConfig",
+ )
+ }
}
}
-
- defaults {
- // Tests, sources, classes, and compilation tasks of the 'debug' build variant will be included in the default report.
- // Thus, information from the 'app1AppDebug' variant will be included in the default report for this project and any project that specifies this project as a dependency.
- mergeWith("debug") // or the name of any build variant needed
- }
}
diff --git a/build.gradle.kts b/build.gradle.kts
index efc5ed4c..a9a820a0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
- id("org.jetbrains.kotlinx.kover") version "0.7.6" apply false
+ id("org.jetbrains.kotlinx.kover") version "0.8.3" apply false
id("com.diffplug.spotless") version "6.25.0" apply false
}
@@ -19,10 +19,10 @@ buildscript {
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}
dependencies {
- classpath("com.android.tools.build:gradle:8.4.0")
+ classpath("com.android.tools.build:gradle:8.5.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
- classpath("dev.drewhamilton.poko:poko-gradle-plugin:0.15.2")
+ classpath("dev.drewhamilton.poko:poko-gradle-plugin:0.17.0")
classpath("com.github.ben-manes:gradle-versions-plugin:0.51.0")
}
}
diff --git a/buildSrc/gradle/wrapper/gradle-wrapper.jar b/buildSrc/gradle/wrapper/gradle-wrapper.jar
index 7f93135c..e6441136 100644
Binary files a/buildSrc/gradle/wrapper/gradle-wrapper.jar and b/buildSrc/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/buildSrc/gradle/wrapper/gradle-wrapper.properties b/buildSrc/gradle/wrapper/gradle-wrapper.properties
index b82aa23a..9355b415 100644
--- a/buildSrc/gradle/wrapper/gradle-wrapper.properties
+++ b/buildSrc/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/buildSrc/src/main/kotlin/deps.kt b/buildSrc/src/main/kotlin/deps.kt
index c40f218b..349b2e5a 100644
--- a/buildSrc/src/main/kotlin/deps.kt
+++ b/buildSrc/src/main/kotlin/deps.kt
@@ -7,7 +7,7 @@ import org.gradle.plugin.use.PluginDependenciesSpec
import org.gradle.plugin.use.PluginDependencySpec
const val ktlintVersion = "1.0.0"
-const val kotlinVersion = "1.9.24"
+const val kotlinVersion = "2.0.20"
object appConfig {
const val applicationId = "com.hoc.flowmvi"
@@ -26,7 +26,7 @@ object appConfig {
object deps {
object androidx {
- const val appCompat = "androidx.appcompat:appcompat:1.6.1"
+ const val appCompat = "androidx.appcompat:appcompat:1.7.0"
const val coreKtx = "androidx.core:core-ktx:1.13.1"
const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4"
const val recyclerView = "androidx.recyclerview:recyclerview:1.3.2"
@@ -36,7 +36,7 @@ object deps {
}
object lifecycle {
- private const val version = "2.8.0"
+ private const val version = "2.8.4"
const val viewModelKtx = "androidx.lifecycle:lifecycle-viewmodel-ktx:$version" // viewModelScope
const val runtimeKtx = "androidx.lifecycle:lifecycle-runtime-ktx:$version" // lifecycleScope
@@ -68,7 +68,7 @@ object deps {
const val test = "io.insert-koin:koin-test:$version"
}
- const val coil = "io.coil-kt:coil:2.6.0"
+ const val coil = "io.coil-kt:coil:2.7.0"
const val viewBindingDelegate = "com.github.hoc081098:ViewBindingDelegate:1.4.0"
const val flowExt = "io.github.hoc081098:FlowExt:1.0.0-RC"
const val timber = "com.jakewharton.timber:timber:5.0.1"
@@ -82,15 +82,15 @@ object deps {
const val junit = "junit:junit:4.13.2"
object androidx {
- const val core = "androidx.test:core-ktx:1.5.0"
- const val junit = "androidx.test.ext:junit-ktx:1.1.5"
+ const val core = "androidx.test:core-ktx:1.6.1"
+ const val junit = "androidx.test.ext:junit-ktx:1.2.1"
object espresso {
- const val core = "androidx.test.espresso:espresso-core:3.5.1"
+ const val core = "androidx.test.espresso:espresso-core:3.6.1"
}
}
- const val mockk = "io.mockk:mockk:1.13.10"
+ const val mockk = "io.mockk:mockk:1.13.12"
const val kotlinJUnit = "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
}
}
diff --git a/data/src/main/java/com/hoc/flowmvi/data/UserRepositoryImpl.kt b/data/src/main/java/com/hoc/flowmvi/data/UserRepositoryImpl.kt
index a04bc0b5..9fae3d28 100644
--- a/data/src/main/java/com/hoc/flowmvi/data/UserRepositoryImpl.kt
+++ b/data/src/main/java/com/hoc/flowmvi/data/UserRepositoryImpl.kt
@@ -3,7 +3,6 @@ package com.hoc.flowmvi.data
import arrow.core.Either.Companion.catch as catchEither
import arrow.core.getOrElse
import arrow.core.left
-import arrow.core.leftWiden
import arrow.core.raise.either
import arrow.core.right
import com.hoc.flowmvi.core.EitherNes
@@ -16,6 +15,7 @@ import com.hoc.flowmvi.domain.model.User
import com.hoc.flowmvi.domain.model.UserError
import com.hoc.flowmvi.domain.model.UserValidationError
import com.hoc.flowmvi.domain.repository.UserRepository
+import com.hoc081098.flowext.FlowExtPreview
import com.hoc081098.flowext.catchAndReturn
import com.hoc081098.flowext.flowFromSuspend
import com.hoc081098.flowext.retryWithExponentialBackoff
@@ -79,6 +79,7 @@ internal class UserRepositoryImpl(
) { it is IOException }
.first()
+ @OptIn(FlowExtPreview::class)
override fun getUsers() =
changesFlow
.onEach { Timber.d("[USER_REPO] Change=$it") }
@@ -89,7 +90,7 @@ internal class UserRepositoryImpl(
is Change.Added -> acc + change.user
}
}.onEach { Timber.d("[USER_REPO] Emit users.size=${it.size} ") }
- .map { it.right().leftWiden() }
+ .map { it.right() }
.catchAndReturn {
logError(it, "getUsers")
errorMapper(it).left()
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index b82aa23a..9355b415 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME