Files
mihon/domain/build.gradle.kts
AntsyLich f921ec07a6 Use an app scoped CoroutineScope
Replaces the eight ad hoc application lifetime scopes and the GlobalScope
launchUI/launchIO/launchNow helpers with a single injected
CoroutineScope(SupervisorJob() + Dispatchers.IO), qualified by
@AppCoroutineScope.

Every scope this replaces was already on IO, or named IO explicitly, so
call sites keep their dispatcher. The two that need the main thread use
scope.launchUI. Scopes with a real cancellation point keep their own:
HttpPageLoader, ShizukuInstaller and the reader viewers. Only
HttpPageLoader's page list cache save moves to the app scope, since it
runs after recycle() has cancelled the loader's own scope.

NotificationReceiver now holds the broadcast open with goAsync() while
its work runs, so the process isn't torn down mid update.

This reverts the revert of #3403. It was reverted for #3429, where
restore() dropped every download because SourceManager.get() returned
null until the extensions had loaded. That surface suspends since #3869,
so the race is gone.
2026-10-10 17:37:45 +06:00

41 lines
988 B
Kotlin

plugins {
alias(mihonx.plugins.android.library)
alias(mihonx.plugins.spotless)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.metro)
}
android {
namespace = "tachiyomi.domain"
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi")
}
}
dependencies {
implementation(projects.sourceApi)
implementation(projects.core.common)
implementation(projects.core.metro)
implementation(libs.metro.runtime)
implementation(libs.bundles.kotlinx.coroutines)
implementation(libs.bundles.serialization)
implementation(libs.kotlinx.datetime)
implementation(libs.unifile)
api(libs.androidx.paging.runtime)
compileOnly(platform(libs.androidx.compose.bom))
compileOnly(libs.androidx.compose.runtimeAnnotation)
testImplementation(libs.bundles.test)
testImplementation(libs.kotlinx.coroutines.test)
testRuntimeOnly(libs.junit.platform.launcher)
}