migrate to libs.versions.toml version catalog

This commit is contained in:
johan12345
2026-05-25 12:59:31 +02:00
parent bb50f0bcc4
commit 4fa4831fcb
4 changed files with 229 additions and 108 deletions

View File

@@ -3,14 +3,14 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import java.util.Base64
plugins {
id("com.adarshr.test-logger") version "4.0.0"
id("com.android.application")
id("kotlin-parcelize")
id("com.google.devtools.ksp") version "2.3.5"
id("com.android.legacy-kapt") // needed for dataBinding since it does not support KSP
id("dev.zacsweers.moshix") version "0.35.0"
id("androidx.navigation.safeargs.kotlin")
id("com.mikepenz.aboutlibraries.plugin")
alias(libs.plugins.test.logger)
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.android.legacy.kapt) // needed for dataBinding since it does not support KSP
alias(libs.plugins.moshix)
alias(libs.plugins.navigation.safeargs)
alias(libs.plugins.aboutlibraries)
}
@@ -299,122 +299,111 @@ aboutLibraries {
}
dependencies {
val kotlinVersion: String by rootProject.extra
val aboutLibsVersion: String by rootProject.extra
val navVersion: String by rootProject.extra
val normalImplementation by configurations
val googleImplementation by configurations
val automotiveImplementation by configurations
val fossImplementation by configurations
val testGoogleImplementation by configurations
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion")
implementation("androidx.appcompat:appcompat:1.7.1")
implementation("androidx.core:core-ktx:1.17.0")
implementation("androidx.core:core-splashscreen:1.2.0")
implementation("androidx.activity:activity-ktx:1.11.0")
implementation("androidx.fragment:fragment-ktx:1.8.9")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.preference:preference-ktx:1.2.1")
implementation("com.google.android.material:material:1.13.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.1")
implementation("androidx.recyclerview:recyclerview:1.4.0")
implementation("androidx.browser:browser:1.9.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.viewpager2:viewpager2:1.1.0")
implementation("androidx.security:security-crypto:1.1.0")
implementation("androidx.work:work-runtime-ktx:2.10.5")
implementation("com.github.ev-map:CustomBottomSheetBehavior:e48f73ea7b")
implementation("com.squareup.retrofit2:retrofit:3.0.0")
implementation("com.squareup.retrofit2:converter-moshi:3.0.0")
implementation("com.squareup.okhttp3:okhttp:4.12.0")
implementation("com.squareup.okhttp3:okhttp-urlconnection:4.12.0")
implementation("com.squareup.moshi:moshi-kotlin:1.15.2")
implementation("com.squareup.moshi:moshi-adapters:1.15.2")
implementation("com.markomilos.jsonapi:jsonapi-retrofit:1.1.0")
implementation("io.coil-kt:coil:2.7.0")
implementation("com.github.ev-map:StfalconImageViewer:c6ba219517")
implementation("com.mikepenz:aboutlibraries-core:$aboutLibsVersion")
implementation("com.mikepenz:aboutlibraries:$aboutLibsVersion")
implementation("com.airbnb.android:lottie:6.6.10")
implementation("io.michaelrocks.bimap:bimap:1.1.0")
implementation("com.github.pengrad:mapscaleview:1.6.0")
implementation("com.github.romandanylyk:PageIndicatorView:b1bad589b5")
implementation("com.github.ev-map:locale-config-x:58b036abf4")
implementation(libs.kotlin.stdlib.jdk7)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.activity.ktx)
implementation(libs.androidx.fragment.ktx)
implementation(libs.androidx.cardview)
implementation(libs.androidx.preference.ktx)
implementation(libs.material)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.recyclerview)
implementation(libs.androidx.browser)
implementation(libs.androidx.swiperefreshlayout)
implementation(libs.androidx.viewpager2)
implementation(libs.androidx.security.crypto)
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.custom.bottom.sheet.behavior)
implementation(libs.retrofit)
implementation(libs.retrofit.converter.moshi)
implementation(libs.okhttp)
implementation(libs.okhttp.urlconnection)
implementation(libs.moshi.kotlin)
implementation(libs.moshi.adapters)
implementation(libs.jsonapi.retrofit)
implementation(libs.coil)
implementation(libs.stfalcon.image.viewer)
implementation(libs.aboutlibraries.core)
implementation(libs.aboutlibraries)
implementation(libs.lottie)
implementation(libs.bimap)
implementation(libs.mapscaleview)
implementation(libs.page.indicator.view)
implementation(libs.locale.config.x)
// Android Auto
val carAppVersion = "1.8.0-beta01"
implementation("androidx.car.app:app:$carAppVersion")
normalImplementation("androidx.car.app:app-projected:$carAppVersion")
automotiveImplementation("androidx.car.app:app-automotive:$carAppVersion")
implementation(libs.androidx.car.app)
normalImplementation(libs.androidx.car.app.projected)
automotiveImplementation(libs.androidx.car.app.automotive)
// AnyMaps
val anyMapsVersion = "e087fcdf86"
implementation("com.github.ev-map.AnyMaps:anymaps-base:$anyMapsVersion")
googleImplementation("com.github.ev-map.AnyMaps:anymaps-google:$anyMapsVersion")
googleImplementation("com.google.android.gms:play-services-maps:19.2.0")
implementation("com.github.ev-map.AnyMaps:anymaps-maplibre:$anyMapsVersion") {
implementation(libs.anymaps.base)
googleImplementation(libs.anymaps.google)
googleImplementation(libs.play.services.maps)
implementation(libs.anymaps.maplibre) {
// exclude Vulkan version and use OpenGL ES 3.0 version for now for better compatibility
exclude("org.maplibre.gl", "android-sdk")
}
implementation("org.maplibre.gl:android-sdk-opengl:13.1.0")
implementation(libs.maplibre.android.sdk.opengl)
// Google Places
googleImplementation("com.google.android.libraries.places:places:3.5.0")
googleImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.10.2")
googleImplementation(libs.places)
googleImplementation(libs.kotlinx.coroutines.play.services)
// Mapbox Geocoding
implementation("com.mapbox.mapboxsdk:mapbox-sdk-services:5.8.0")
implementation(libs.mapbox.sdk.services)
// navigation library
implementation("androidx.navigation:navigation-fragment-ktx:$navVersion")
implementation("androidx.navigation:navigation-ui-ktx:$navVersion")
implementation(libs.androidx.navigation.fragment.ktx)
implementation(libs.androidx.navigation.ui.ktx)
// viewmodel library
val lifecycleVersion = "2.9.2"
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
implementation(libs.androidx.lifecycle.viewmodel.ktx)
implementation(libs.androidx.lifecycle.livedata.ktx)
// room library
val roomVersion = "2.7.2"
implementation("androidx.room:room-runtime:$roomVersion")
ksp("androidx.room:room-compiler:$roomVersion")
implementation("androidx.room:room-ktx:$roomVersion")
implementation("com.github.anboralabs:spatia-room:1.0.1") {
implementation(libs.androidx.room.runtime)
ksp(libs.androidx.room.compiler)
implementation(libs.androidx.room.ktx)
implementation(libs.spatia.room) {
exclude("com.github.dalgarins", "android-spatialite")
}
// forked version with upgraded libxml 2.15.2 & APP_STL := c++_static
implementation("io.github.ev-map:android-spatialite:2.3.0-alpha")
implementation(libs.android.spatialite)
// billing library
val billingVersion = "7.0.0"
googleImplementation("com.android.billingclient:billing:$billingVersion")
googleImplementation("com.android.billingclient:billing-ktx:$billingVersion")
googleImplementation(libs.billing)
googleImplementation(libs.billing.ktx)
// ACRA (crash reporting)
val acraVersion = "5.12.0"
implementation("ch.acra:acra-http:$acraVersion")
implementation("ch.acra:acra-dialog:$acraVersion")
implementation("ch.acra:acra-limiter:$acraVersion")
implementation(libs.acra.http)
implementation(libs.acra.dialog)
implementation(libs.acra.limiter)
// debug tools
debugImplementation("com.jakewharton.timber:timber:5.0.1")
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.14")
debugImplementation(libs.timber)
debugImplementation(libs.leakcanary.android)
// testing
testImplementation("junit:junit:4.13.2")
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
testImplementation(libs.junit4)
testImplementation(libs.okhttp.mockwebserver)
//noinspection GradleDependency
testImplementation("org.robolectric:robolectric:4.16")
testImplementation("androidx.test:core:1.7.0")
testImplementation("androidx.arch.core:core-testing:2.2.0")
testImplementation("androidx.car.app:app-testing:$carAppVersion")
testImplementation(libs.robolectric)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.arch.core.testing)
testImplementation(libs.androidx.car.app.testing)
androidTestImplementation("androidx.test.ext:junit:1.3.0")
androidTestImplementation("androidx.test.espresso:espresso-core:3.7.0")
androidTestImplementation("androidx.arch.core:core-testing:2.2.0")
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.espresso.core)
androidTestImplementation(libs.androidx.arch.core.testing)
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.5")
coreLibraryDesugaring(libs.desugar.jdk.libs)
}
fun decode(s: String, key: String): String {

View File

@@ -1,24 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
val kotlinVersion by extra("2.3.20")
val aboutLibsVersion by extra("12.2.4")
val navVersion by extra("2.9.6")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath("com.android.tools.build:gradle:9.0.1")
classpath("com.android.legacy-kapt:com.android.legacy-kapt.gradle.plugin:9.0.1")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibsVersion")
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.legacy.kapt) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.test.logger) apply false
alias(libs.plugins.moshix) apply false
alias(libs.plugins.navigation.safeargs) apply false
alias(libs.plugins.aboutlibraries) apply false
}
allprojects {

134
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,134 @@
[versions]
agp = "9.0.1"
kotlin = "2.3.20"
ksp = "2.3.5"
testLogger = "4.0.0"
moshix = "0.35.0"
aboutlibraries = "12.2.4"
navigation = "2.9.6"
appcompat = "1.7.1"
coreKtx = "1.17.0"
coreSplashscreen = "1.2.0"
activityKtx = "1.11.0"
fragmentKtx = "1.8.9"
preferenceKtx = "1.2.1"
material = "1.13.0"
constraintlayout = "2.2.1"
recyclerview = "1.4.0"
browser = "1.9.0"
swipeRefreshLayout = "1.1.0"
viewpager2 = "1.1.0"
securityCrypto = "1.1.0"
workRuntime = "2.10.5"
retrofit = "3.0.0"
okhttp = "4.12.0"
moshi = "1.15.2"
jsonapiRetrofit = "1.1.0"
coil = "2.7.0"
lottie = "6.6.10"
bimap = "1.1.0"
mapscaleview = "1.6.0"
carApp = "1.8.0-beta01"
anymaps = "e087fcdf86"
playServicesMaps = "19.2.0"
places = "3.5.0"
kotlinxCoroutinesPlayServices = "1.10.2"
mapLibre = "13.1.0"
mapboxServices = "5.8.0"
lifecycle = "2.9.2"
room = "2.7.2"
spatiaRoom = "1.0.1"
androidSpatialite = "2.3.0-alpha"
billing = "7.0.0"
acra = "5.12.0"
timber = "5.0.1"
leakcanary = "2.14"
junit4 = "4.13.2"
robolectric = "4.16"
androidxTestCore = "1.7.0"
androidxArchCoreTesting = "2.2.0"
androidxTestExtJunit = "1.3.0"
espressoCore = "3.7.0"
desugarJdkLibs = "2.1.5"
[libraries]
kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin" }
androidx-appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
androidx-activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activityKtx" }
androidx-fragment-ktx = { module = "androidx.fragment:fragment-ktx", version.ref = "fragmentKtx" }
androidx-cardview = { module = "androidx.cardview:cardview", version = "1.0.0" }
androidx-preference-ktx = { module = "androidx.preference:preference-ktx", version.ref = "preferenceKtx" }
material = { module = "com.google.android.material:material", version.ref = "material" }
androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayout", version.ref = "constraintlayout" }
androidx-recyclerview = { module = "androidx.recyclerview:recyclerview", version.ref = "recyclerview" }
androidx-browser = { module = "androidx.browser:browser", version.ref = "browser" }
androidx-swiperefreshlayout = { module = "androidx.swiperefreshlayout:swiperefreshlayout", version.ref = "swipeRefreshLayout" }
androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref = "viewpager2" }
androidx-security-crypto = { module = "androidx.security:security-crypto", version.ref = "securityCrypto" }
androidx-work-runtime-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "workRuntime" }
custom-bottom-sheet-behavior = { module = "com.github.ev-map:CustomBottomSheetBehavior", version = "e48f73ea7b" }
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
retrofit-converter-moshi = { module = "com.squareup.retrofit2:converter-moshi", version.ref = "retrofit" }
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
okhttp-urlconnection = { module = "com.squareup.okhttp3:okhttp-urlconnection", version.ref = "okhttp" }
moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "moshi" }
moshi-adapters = { module = "com.squareup.moshi:moshi-adapters", version.ref = "moshi" }
jsonapi-retrofit = { module = "com.markomilos.jsonapi:jsonapi-retrofit", version.ref = "jsonapiRetrofit" }
coil = { module = "io.coil-kt:coil", version.ref = "coil" }
stfalcon-image-viewer = { module = "com.github.ev-map:StfalconImageViewer", version = "c6ba219517" }
aboutlibraries-core = { module = "com.mikepenz:aboutlibraries-core", version.ref = "aboutlibraries" }
aboutlibraries = { module = "com.mikepenz:aboutlibraries", version.ref = "aboutlibraries" }
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" }
bimap = { module = "io.michaelrocks.bimap:bimap", version.ref = "bimap" }
mapscaleview = { module = "com.github.pengrad:mapscaleview", version.ref = "mapscaleview" }
page-indicator-view = { module = "com.github.romandanylyk:PageIndicatorView", version = "b1bad589b5" }
locale-config-x = { module = "com.github.ev-map:locale-config-x", version = "58b036abf4" }
androidx-car-app = { module = "androidx.car.app:app", version.ref = "carApp" }
androidx-car-app-projected = { module = "androidx.car.app:app-projected", version.ref = "carApp" }
androidx-car-app-automotive = { module = "androidx.car.app:app-automotive", version.ref = "carApp" }
androidx-car-app-testing = { module = "androidx.car.app:app-testing", version.ref = "carApp" }
anymaps-base = { module = "com.github.ev-map.AnyMaps:anymaps-base", version.ref = "anymaps" }
anymaps-google = { module = "com.github.ev-map.AnyMaps:anymaps-google", version.ref = "anymaps" }
play-services-maps = { module = "com.google.android.gms:play-services-maps", version.ref = "playServicesMaps" }
anymaps-maplibre = { module = "com.github.ev-map.AnyMaps:anymaps-maplibre", version.ref = "anymaps" }
maplibre-android-sdk-opengl = { module = "org.maplibre.gl:android-sdk-opengl", version.ref = "mapLibre" }
places = { module = "com.google.android.libraries.places:places", version.ref = "places" }
kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "kotlinxCoroutinesPlayServices" }
mapbox-sdk-services = { module = "com.mapbox.mapboxsdk:mapbox-sdk-services", version.ref = "mapboxServices" }
androidx-navigation-fragment-ktx = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "navigation" }
androidx-navigation-ui-ktx = { module = "androidx.navigation:navigation-ui-ktx", version.ref = "navigation" }
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "lifecycle" }
androidx-lifecycle-livedata-ktx = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "lifecycle" }
androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
androidx-room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
androidx-room-ktx = { module = "androidx.room:room-ktx", version.ref = "room" }
spatia-room = { module = "com.github.anboralabs:spatia-room", version.ref = "spatiaRoom" }
android-spatialite = { module = "io.github.ev-map:android-spatialite", version.ref = "androidSpatialite" }
billing = { module = "com.android.billingclient:billing", version.ref = "billing" }
billing-ktx = { module = "com.android.billingclient:billing-ktx", version.ref = "billing" }
acra-http = { module = "ch.acra:acra-http", version.ref = "acra" }
acra-dialog = { module = "ch.acra:acra-dialog", version.ref = "acra" }
acra-limiter = { module = "ch.acra:acra-limiter", version.ref = "acra" }
timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" }
leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanary" }
junit4 = { module = "junit:junit", version.ref = "junit4" }
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
robolectric = { module = "org.robolectric:robolectric", version.ref = "robolectric" }
androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" }
androidx-arch-core-testing = { module = "androidx.arch.core:core-testing", version.ref = "androidxArchCoreTesting" }
androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidxTestExtJunit" }
androidx-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espressoCore" }
desugar-jdk-libs = { module = "com.android.tools:desugar_jdk_libs", version.ref = "desugarJdkLibs" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-legacy-kapt = { id = "com.android.legacy-kapt", version.ref = "agp" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
test-logger = { id = "com.adarshr.test-logger", version.ref = "testLogger" }
moshix = { id = "dev.zacsweers.moshix", version.ref = "moshix" }
navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "navigation" }
aboutlibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlibraries" }

View File

@@ -1,3 +1,11 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}