Introduce version catalog for dependency management

Adds a libs.versions.toml file to centralize dependency management. This improves dependency consistency, reduces maintenance overhead, and simplifies version updates across modules.
This commit is contained in:
Tamim Hossain 2024-07-28 11:37:08 +06:00
parent 2fc279f4ae
commit 2a18ab4a5d
3 changed files with 175 additions and 59 deletions

View file

@ -154,84 +154,84 @@ repositories {
dependencies {
// Testing
testImplementation("junit:junit:4.13.2")
testImplementation("org.json:json:20240303")
androidTestImplementation("androidx.test:core")
implementation("androidx.test.ext:junit-ktx:1.2.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
testImplementation(libs.junit)
testImplementation(libs.json)
androidTestImplementation(libs.core)
implementation(libs.junit.ktx)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
// Android Core & Lifecycle
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.8.3")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.3")
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
implementation(libs.core.ktx)
implementation(libs.appcompat)
implementation(libs.navigation.ui.ktx)
implementation(libs.lifecycle.livedata.ktx)
implementation(libs.lifecycle.viewmodel.ktx)
implementation(libs.navigation.fragment.ktx)
// Design & UI
implementation("jp.wasabeef:glide-transformations:4.3.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation(libs.glide.transformations)
implementation(libs.preference.ktx)
implementation(libs.material)
implementation(libs.constraintlayout)
implementation(libs.swiperefreshlayout)
// Glide Module
ksp("com.github.bumptech.glide:ksp:4.16.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("com.github.bumptech.glide:okhttp3-integration:4.16.0")
ksp(libs.ksp)
implementation(libs.glide)
implementation(libs.okhttp3.integration)
// For KSP -> Official Annotation Processors are Not Yet Supported for KSP
ksp("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
implementation("com.google.guava:guava:33.2.1-android")
implementation("dev.zacsweers.autoservice:auto-service-ksp:1.2.0")
ksp(libs.auto.service.ksp)
implementation(libs.guava)
implementation(libs.auto.service.ksp)
// Media 3 (ExoPlayer)
implementation("androidx.media3:media3-ui:1.1.1")
implementation("androidx.media3:media3-cast:1.1.1")
implementation("androidx.media3:media3-common:1.1.1")
implementation("androidx.media3:media3-session:1.1.1")
implementation("androidx.media3:media3-exoplayer:1.1.1")
implementation("com.google.android.mediahome:video:1.0.0")
implementation("androidx.media3:media3-exoplayer-hls:1.1.1")
implementation("androidx.media3:media3-exoplayer-dash:1.1.1")
implementation("androidx.media3:media3-datasource-okhttp:1.1.1")
implementation(libs.media3.ui)
implementation(libs.media3.cast)
implementation(libs.media3.common)
implementation(libs.media3.session)
implementation(libs.media3.exoplayer)
implementation(libs.video)
implementation(libs.media3.exoplayer.hls)
implementation(libs.media3.exoplayer.dash)
implementation(libs.media3.datasource.okhttp)
// PlayBack
implementation("com.jaredrummler:colorpicker:1.1.0") // Subtitle Color Picker
implementation("com.github.recloudstream:media-ffmpeg:1.1.0") // Custom FF-MPEG Lib for Audio Codecs
implementation("com.github.teamnewpipe:NewPipeExtractor:2d36945") /* For Trailers
implementation(libs.colorpicker) // Subtitle Color Picker
implementation(libs.media.ffmpeg) // Custom FF-MPEG Lib for Audio Codecs
implementation(libs.newpipeextractor) /* For Trailers
^ Update to Latest Commits if Trailers Misbehave, github.com/TeamNewPipe/NewPipeExtractor/commits/dev */
implementation("com.github.albfernandez:juniversalchardet:2.5.0") // Subtitle Decoding
implementation(libs.juniversalchardet) // Subtitle Decoding
// Crash Reports (AcraApplication.kt)
implementation("ch.acra:acra-core:5.11.3")
implementation("ch.acra:acra-toast:5.11.3")
implementation(libs.acra.core)
implementation(libs.acra.toast)
// UI Stuff
implementation("com.facebook.shimmer:shimmer:0.5.0") // Shimmering Effect (Loading Skeleton)
implementation("androidx.palette:palette-ktx:1.0.0") // Palette For Images -> Colors
implementation("androidx.tvprovider:tvprovider:1.0.0")
implementation("com.github.discord:OverlappingPanels:0.1.5") // Gestures
implementation ("androidx.biometric:biometric:1.2.0-alpha05") // Fingerprint Authentication
implementation("com.github.rubensousa:previewseekbar-media3:1.1.1.0") // SeekBar Preview
implementation("io.github.g0dkar:qrcode-kotlin:4.2.0") // QR code for PIN Auth on TV
implementation(libs.shimmer) // Shimmering Effect (Loading Skeleton)
implementation(libs.palette.ktx) // Palette For Images -> Colors
implementation(libs.tvprovider)
implementation(libs.overlappingpanels) // Gestures
implementation (libs.biometric) // Fingerprint Authentication
implementation(libs.previewseekbar.media3) // SeekBar Preview
implementation(libs.qrcode.kotlin) // QR code for PIN Auth on TV
// Extensions & Other Libs
implementation("org.mozilla:rhino:1.7.15") // run JavaScript
implementation("me.xdrop:fuzzywuzzy:1.4.0") // Library/Ext Searching with Levenshtein Distance
implementation("com.github.LagradOst:SafeFile:0.0.6") // To Prevent the URI File Fu*kery
implementation("org.conscrypt:conscrypt-android:2.5.2") // To Fix SSL Fu*kery on Android 9
implementation("com.uwetrottmann.tmdb2:tmdb-java:2.11.0") // TMDB API v3 Wrapper Made with RetroFit
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.4")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.1") /* JSON Parser
implementation(libs.rhino) // run JavaScript
implementation(libs.fuzzywuzzy) // Library/Ext Searching with Levenshtein Distance
implementation(libs.safefile) // To Prevent the URI File Fu*kery
implementation(libs.conscrypt.android) // To Fix SSL Fu*kery on Android 9
implementation(libs.tmdb.java) // TMDB API v3 Wrapper Made with RetroFit
coreLibraryDesugaring(libs.desugar.jdk.libs)
implementation(libs.jackson.module.kotlin) /* JSON Parser
^ Don't Bump Jackson above 2.13.1 , Crashes on Android TV's and FireSticks that have Min API
Level 25 or Less. */
// Downloading & Networking
implementation("androidx.work:work-runtime:2.9.0")
implementation("androidx.work:work-runtime-ktx:2.9.0")
implementation("com.github.Blatzar:NiceHttp:0.4.11") // HTTP Lib
implementation(libs.work.runtime)
implementation(libs.work.runtime.ktx)
implementation(libs.nicehttp) // HTTP Lib
implementation(project(":library") {
// There does not seem to be a good way of getting the android flavor.

View file

@ -5,11 +5,11 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:8.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10")
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.dokka.gradle.plugin)
// Universal build config
classpath("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:0.15.1")
classpath(libs.buildkonfig.gradle.plugin)
}
}

116
gradle/libs.versions.toml Normal file
View file

@ -0,0 +1,116 @@
[versions]
acraCore = "5.11.3"
appcompat = "1.7.0"
autoServiceKsp = "1.2.0"
biometric = "1.2.0-alpha05"
buildkonfigGradlePlugin = "0.15.1"
colorpicker = "1.1.0"
conscryptAndroid = "2.5.2"
constraintlayout = "2.1.4"
coreKtx = "1.13.1"
desugar_jdk_libs = "2.0.4"
dokkaGradlePlugin = "1.9.10"
espressoCore = "3.6.1"
fuzzywuzzy = "1.4.0"
glide = "4.16.0"
glideTransformations = "4.3.0"
gradle = "8.2.2"
guava = "33.2.1-android"
jacksonModuleKotlin = "2.13.1"
json = "20240303"
junit = "4.13.2"
junitKtx = "1.2.1"
junitVersion = "1.2.1"
juniversalchardet = "2.5.0"
kotlinGradlePlugin = "1.9.23"
ksp = "4.16.0"
lifecycleLivedataKtx = "2.8.3"
lifecycleViewmodelKtx = "2.8.3"
material = "1.12.0"
media3Cast = "1.1.1"
media3Common = "1.1.1"
media3DatasourceOkhttp = "1.1.1"
media3Exoplayer = "1.1.1"
media3ExoplayerDash = "1.1.1"
media3ExoplayerHls = "1.1.1"
media3Session = "1.1.1"
media3Ui = "1.1.1"
mediaFfmpeg = "1.1.0"
navigationFragmentKtx = "2.7.7"
navigationUiKtx = "2.7.7"
newpipeextractor = "2d36945"
nicehttp = "0.4.11"
okhttp3Integration = "4.16.0"
overlappingpanels = "0.1.5"
paletteKtx = "1.0.0"
preferenceKtx = "1.2.1"
previewseekbarMedia3 = "1.1.1.0"
qrcodeKotlin = "4.2.0"
rhino = "1.7.15"
safefile = "0.0.6"
shimmer = "0.5.0"
swiperefreshlayout = "1.1.0"
tmdbJava = "2.11.0"
tvprovider = "1.0.0"
video = "1.0.0"
workRuntime = "2.9.0"
workRuntimeKtx = "2.9.0"
[libraries]
acra-core = { module = "ch.acra:acra-core", version.ref = "acraCore" }
acra-toast = { module = "ch.acra:acra-toast", version.ref = "acraCore" }
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
auto-service-ksp = { module = "dev.zacsweers.autoservice:auto-service-ksp", version.ref = "autoServiceKsp" }
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
buildkonfig-gradle-plugin = { module = "com.codingfeline.buildkonfig:buildkonfig-gradle-plugin", version.ref = "buildkonfigGradlePlugin" }
colorpicker = { module = "com.jaredrummler:colorpicker", version.ref = "colorpicker" }
conscrypt-android = { module = "org.conscrypt:conscrypt-android", version.ref = "conscryptAndroid" }
constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
core = { module = "androidx.test:core" }
core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
desugar_jdk_libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugar_jdk_libs" }
dokka-gradle-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokkaGradlePlugin" }
espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
ext-junit = { module = "androidx.test.ext:junit", version.ref = "junitVersion" }
fuzzywuzzy = { module = "me.xdrop:fuzzywuzzy", version.ref = "fuzzywuzzy" }
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
glide-transformations = { module = "jp.wasabeef:glide-transformations", version.ref = "glideTransformations" }
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
guava = { module = "com.google.guava:guava", version.ref = "guava" }
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jacksonModuleKotlin" }
json = { module = "org.json:json", version.ref = "json" }
junit = { module = "junit:junit", version.ref = "junit" }
junit-ktx = { module = "androidx.test.ext:junit-ktx", version.ref = "junitKtx" }
juniversalchardet = { module = "com.github.albfernandez:juniversalchardet", version.ref = "juniversalchardet" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
ksp = { module = "com.github.bumptech.glide:ksp", version.ref = "ksp" }
lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycleLivedataKtx" }
lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycleViewmodelKtx" }
material = { module = "com.google.android.material:material", version.ref = "material" }
media-ffmpeg = { module = "com.github.recloudstream:media-ffmpeg", version.ref = "mediaFfmpeg" }
media3-cast = { module = "androidx.media3:media3-cast", version.ref = "media3Cast" }
media3-common = { module = "androidx.media3:media3-common", version.ref = "media3Common" }
media3-datasource-okhttp = { module = "androidx.media3:media3-datasource-okhttp", version.ref = "media3DatasourceOkhttp" }
media3-exoplayer = { module = "androidx.media3:media3-exoplayer", version.ref = "media3Exoplayer" }
media3-exoplayer-dash = { module = "androidx.media3:media3-exoplayer-dash", version.ref = "media3ExoplayerDash" }
media3-exoplayer-hls = { module = "androidx.media3:media3-exoplayer-hls", version.ref = "media3ExoplayerHls" }
media3-session = { module = "androidx.media3:media3-session", version.ref = "media3Session" }
media3-ui = { module = "androidx.media3:media3-ui", version.ref = "media3Ui" }
navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigationUiKtx" }
newpipeextractor = { module = "com.github.teamnewpipe:NewPipeExtractor", version.ref = "newpipeextractor" }
nicehttp = { module = "com.github.Blatzar:NiceHttp", version.ref = "nicehttp" }
okhttp3-integration = { module = "com.github.bumptech.glide:okhttp3-integration", version.ref = "okhttp3Integration" }
overlappingpanels = { module = "com.github.discord:OverlappingPanels", version.ref = "overlappingpanels" }
palette-ktx = { module = "androidx.palette:palette-ktx", version.ref = "paletteKtx" }
preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
previewseekbar-media3 = { module = "com.github.rubensousa:previewseekbar-media3", version.ref = "previewseekbarMedia3" }
qrcode-kotlin = { module = "io.github.g0dkar:qrcode-kotlin", version.ref = "qrcodeKotlin" }
rhino = { module = "org.mozilla:rhino", version.ref = "rhino" }
safefile = { module = "com.github.LagradOst:SafeFile", version.ref = "safefile" }
shimmer = { module = "com.facebook.shimmer:shimmer", version.ref = "shimmer" }
swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swiperefreshlayout" }
tmdb-java = { module = "com.uwetrottmann.tmdb2:tmdb-java", version.ref = "tmdbJava" }
tvprovider = { module = "androidx.tvprovider:tvprovider", version.ref = "tvprovider" }
video = { module = "com.google.android.mediahome:video", version.ref = "video" }
work-runtime = { module = "androidx.work:work-runtime", version.ref = "workRuntime" }
work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "workRuntimeKtx" }