mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Refactor dependencies, add Coroutines, Coil and Timber
This commit is contained in:
+21
-12
@@ -58,23 +58,32 @@ afterEvaluate {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
// Kotlin
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
implementation(Dependencies.Kotlin.coroutinesCore)
|
||||
implementation(Dependencies.Kotlin.coroutinesAndroid)
|
||||
|
||||
// Core
|
||||
implementation(Dependencies.Core.appCompat)
|
||||
implementation(Dependencies.Core.coreKtx)
|
||||
implementation(Dependencies.Core.webkit)
|
||||
|
||||
// UI
|
||||
implementation(Dependencies.UI.webkitX)
|
||||
implementation(Dependencies.UI.coil)
|
||||
|
||||
// Health
|
||||
implementation(Dependencies.Health.timber)
|
||||
debugImplementation(Dependencies.Health.leakCanary)
|
||||
|
||||
// Testing
|
||||
testImplementation(Dependencies.Testing.junit5)
|
||||
testRuntimeOnly(Dependencies.Testing.junit5Engine)
|
||||
testImplementation(Dependencies.Testing.kotestAssertions)
|
||||
testImplementation(Dependencies.Testing.kotestProperty)
|
||||
testImplementation(Dependencies.Testing.kotestRunner)
|
||||
testImplementation(Dependencies.Testing.mockk)
|
||||
androidTestImplementation(Dependencies.Testing.androidXRunner)
|
||||
androidTestImplementation(Dependencies.Testing.androidXEspresso)
|
||||
|
||||
// LeakCanary
|
||||
debugImplementation(Dependencies.Testing.leakCanary)
|
||||
testImplementation(Dependencies.Health.junit5)
|
||||
testRuntimeOnly(Dependencies.Health.junit5Engine)
|
||||
testImplementation(Dependencies.Health.kotestAssertions)
|
||||
testImplementation(Dependencies.Health.kotestProperty)
|
||||
testImplementation(Dependencies.Health.kotestRunner)
|
||||
testImplementation(Dependencies.Health.mockk)
|
||||
androidTestImplementation(Dependencies.Health.androidXRunner)
|
||||
androidTestImplementation(Dependencies.Health.androidXEspresso)
|
||||
}
|
||||
|
||||
tasks.withType<DependencyUpdatesTask> {
|
||||
|
||||
@@ -6,21 +6,27 @@ object Dependencies {
|
||||
const val dependencyUpdates = "0.29.0"
|
||||
const val nodeGradle = "2.2.4"
|
||||
|
||||
// KotlinX
|
||||
const val coroutinesCore = "1.3.5"
|
||||
const val coroutinesAndroid = "1.3.0"
|
||||
|
||||
// Core
|
||||
const val appCompat = "1.1.0"
|
||||
const val coreKtx = "1.3.0"
|
||||
const val webkit = "1.2.0"
|
||||
|
||||
// Testing
|
||||
// UI
|
||||
const val webkitX = "1.2.0"
|
||||
const val coil = "0.11.0"
|
||||
|
||||
// Health
|
||||
const val timber = "4.7.1"
|
||||
const val leakCanary = "2.4"
|
||||
const val junit5 = "5.6.1"
|
||||
const val kotest = "4.0.5"
|
||||
const val mockk = "1.10.0"
|
||||
const val androidXRunner = "1.2.0"
|
||||
const val androidXEspresso = "3.2.0"
|
||||
|
||||
// Debug
|
||||
const val leakCanary = "2.4"
|
||||
|
||||
fun isStable(version: String): Boolean {
|
||||
return listOf("alpha", "beta", "dev", "rc", "m").none {
|
||||
version.toLowerCase(Locale.ROOT).contains(it)
|
||||
@@ -28,16 +34,27 @@ object Dependencies {
|
||||
}
|
||||
}
|
||||
|
||||
object Kotlin {
|
||||
val coroutinesCore = kotlinx("coroutines-core", Versions.coroutinesCore)
|
||||
val coroutinesAndroid = kotlinx("coroutines-android", Versions.coroutinesAndroid)
|
||||
}
|
||||
|
||||
object Core {
|
||||
const val appCompat = "androidx.appcompat:appcompat:${Versions.appCompat}"
|
||||
const val coreKtx = "androidx.core:core-ktx:${Versions.coreKtx}"
|
||||
const val webkit = "androidx.webkit:webkit:${Versions.webkit}"
|
||||
}
|
||||
|
||||
object UI {
|
||||
const val webkitX = "androidx.webkit:webkit:${Versions.webkitX}"
|
||||
const val coil = "io.coil-kt:coil:${Versions.coil}"
|
||||
}
|
||||
|
||||
/**
|
||||
* Includes logging, debugging, and testing
|
||||
*/
|
||||
object Testing {
|
||||
object Health {
|
||||
const val timber = "com.jakewharton.timber:timber:${Versions.timber}"
|
||||
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
|
||||
const val junit5 = "org.junit.jupiter:junit-jupiter-api:${Versions.junit5}"
|
||||
const val junit5Engine = "org.junit.jupiter:junit-jupiter-engine:${Versions.junit5}"
|
||||
const val kotestAssertions = "io.kotest:kotest-assertions-core-jvm:${Versions.kotest}"
|
||||
@@ -45,10 +62,9 @@ object Dependencies {
|
||||
const val kotestRunner = "io.kotest:kotest-runner-junit5-jvm:${Versions.kotest}"
|
||||
const val mockk = "io.mockk:mockk:${Versions.mockk}"
|
||||
const val androidXRunner = "androidx.test:runner:${Versions.androidXRunner}"
|
||||
const val androidXEspresso =
|
||||
"androidx.test.espresso:espresso-core:${Versions.androidXEspresso}"
|
||||
|
||||
// Debug
|
||||
const val leakCanary = "com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}"
|
||||
const val androidXEspresso = "androidx.test.espresso:espresso-core:${Versions.androidXEspresso}"
|
||||
}
|
||||
|
||||
// Helpers
|
||||
private fun kotlinx(module: String, version: String) = "org.jetbrains.kotlinx:kotlinx-$module:$version"
|
||||
}
|
||||
Reference in New Issue
Block a user