From 32827dc04400d9f618740316447d108258ccf4ed Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 1 Jul 2023 17:34:35 -0700 Subject: [PATCH] Switch Glide's dependencies to a version catalog. (#5183) Version catalogs are officially supported by Gradle as a way to manage dependencies. They're also supported by tools like Renovate. Unfortunately it's only kind of supported by Android Studio, which seems to prefer toml files over settings.gradle. Since Gradle's docs seem to be recommending settings.gradle and are usually ahead of Android, I've chosen to follow Gradle's guidance in the hopes of avoiding a toml -> settings.gradle migration in the future. --- annotation/compiler/build.gradle | 8 +- annotation/compiler/test/build.gradle | 18 ++-- annotation/ksp/build.gradle | 8 +- annotation/ksp/integrationtest/build.gradle | 14 +-- annotation/ksp/test/build.gradle | 14 +-- benchmark/build.gradle | 15 +-- build.gradle | 18 ++-- gradle.properties | 72 +------------ instrumentation/build.gradle | 30 +++--- integration/avif/build.gradle | 8 +- integration/compose/build.gradle | 24 ++--- integration/concurrent/build.gradle | 18 ++-- integration/cronet/build.gradle | 18 ++-- integration/gifencoder/build.gradle | 20 ++-- integration/ktx/build.gradle | 30 +++--- integration/okhttp/build.gradle | 10 +- integration/okhttp3/build.gradle | 10 +- integration/okhttp4/build.gradle | 10 +- integration/recyclerview/build.gradle | 10 +- integration/sqljournaldiskcache/build.gradle | 24 ++--- integration/volley/build.gradle | 26 ++--- library/build.gradle | 38 +++---- library/pmd/build.gradle | 2 +- library/test/build.gradle | 26 ++--- mocks/build.gradle | 12 +-- samples/contacturi/build.gradle | 8 +- samples/flickr/build.gradle | 12 +-- samples/gallery/build.gradle | 16 +-- samples/giphy/build.gradle | 10 +- samples/imgur/build.gradle | 36 +++---- samples/svg/build.gradle | 10 +- settings.gradle | 107 +++++++++++++++++++ testutil/build.gradle | 14 +-- third_party/disklrucache/build.gradle | 10 +- third_party/gif_decoder/build.gradle | 18 ++-- 35 files changed, 382 insertions(+), 342 deletions(-) diff --git a/annotation/compiler/build.gradle b/annotation/compiler/build.gradle index 5d09e8e1aa..7329c93608 100644 --- a/annotation/compiler/build.gradle +++ b/annotation/compiler/build.gradle @@ -11,11 +11,11 @@ configurations { dependencies { jarjar "com.googlecode.jarjar:jarjar:1.3" - compileOnly "com.squareup:javapoet:${JAVAPOET_VERSION}" - compileOnly "com.google.auto.service:auto-service:${AUTO_SERVICE_VERSION}" - compileOnly "com.google.code.findbugs:jsr305:${JSR_305_VERSION}" + compileOnly libs.javapoet + compileOnly libs.autoservice + compileOnly libs.findbugs.jsr305 implementation project(':annotation') - annotationProcessor "com.google.auto.service:auto-service:${AUTO_SERVICE_VERSION}" + annotationProcessor libs.autoservice } javadoc { diff --git a/annotation/compiler/test/build.gradle b/annotation/compiler/test/build.gradle index 1c8294c6e5..925402b22c 100644 --- a/annotation/compiler/test/build.gradle +++ b/annotation/compiler/test/build.gradle @@ -27,11 +27,11 @@ afterEvaluate { } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdk libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } @@ -56,9 +56,9 @@ android { dependencies { testImplementation project(':glide') testImplementation project(':annotation:compiler') - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "com.squareup:javapoet:${JAVAPOET_VERSION}" - testImplementation "com.google.code.findbugs:jsr305:${JSR_305_VERSION}" + testImplementation libs.junit + testImplementation libs.javapoet + testImplementation libs.findbugs.jsr305 // Using 0.10 of compile-testing is required for Android Studio to function, but not for the // gradle build. Not yet clear why, but it looks like some kind of version conflict between // javapoet, guava and/or truth. @@ -68,13 +68,13 @@ dependencies { // confusing. exclude group: "com.google.auto.value", module: "auto-value" } - testImplementation "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" - testImplementation "androidx.fragment:fragment:${ANDROID_X_FRAGMENT_VERSION}" + testImplementation libs.androidx.annotation + testImplementation libs.androidx.fragment // TODO: Find some way to include a similar dependency on java 9+ and re-enable these tests in gradle. // testImplementation files(Jvm.current().getJre().homeDir.getAbsolutePath()+'/lib/rt.jar') testAnnotationProcessor project(':annotation:compiler') - testAnnotationProcessor "com.google.auto.service:auto-service:${AUTO_SERVICE_VERSION}" + testAnnotationProcessor libs.autoservice } task regenerateTestResources { diff --git a/annotation/ksp/build.gradle b/annotation/ksp/build.gradle index b8a62747a8..febb5e62b4 100644 --- a/annotation/ksp/build.gradle +++ b/annotation/ksp/build.gradle @@ -4,11 +4,11 @@ plugins { } dependencies { - implementation("com.squareup:kotlinpoet:1.12.0") + implementation libs.kotlinpoet implementation project(":annotation") - implementation 'com.google.devtools.ksp:symbol-processing-api:1.7.0-1.0.6' - ksp("dev.zacsweers.autoservice:auto-service-ksp:1.0.0") - implementation("com.google.auto.service:auto-service-annotations:1.0.1") + implementation libs.ksp + implementation libs.autoservice.annotations + ksp libs.ksp.autoservice } apply from: "${rootProject.projectDir}/scripts/upload.gradle" diff --git a/annotation/ksp/integrationtest/build.gradle b/annotation/ksp/integrationtest/build.gradle index 610e2716ac..16ee4b0d07 100644 --- a/annotation/ksp/integrationtest/build.gradle +++ b/annotation/ksp/integrationtest/build.gradle @@ -15,24 +15,24 @@ plugins { } android { - compileSdkVersion COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdkVersion MIN_SDK_VERSION as int - targetSdkVersion TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } } dependencies { - implementation "junit:junit:$JUNIT_VERSION" + implementation libs.junit testImplementation project(":annotation:ksp:test") testImplementation project(":annotation:ksp") testImplementation project(":annotation") testImplementation project(":glide") testImplementation project(":integration:okhttp3") - testImplementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:${KOTLIN_COMPILE_TESTING_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "org.jetbrains.kotlin:kotlin-test:${JETBRAINS_KOTLIN_TEST_VERSION}" + testImplementation libs.ksp.compiletesting + testImplementation libs.truth + testImplementation libs.kotlin.test testImplementation project(path: ':annotation:ksp:test') } \ No newline at end of file diff --git a/annotation/ksp/test/build.gradle b/annotation/ksp/test/build.gradle index 64f7287156..8de75bffa7 100644 --- a/annotation/ksp/test/build.gradle +++ b/annotation/ksp/test/build.gradle @@ -4,22 +4,22 @@ plugins { } android { - compileSdkVersion COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdkVersion MIN_SDK_VERSION as int - targetSdkVersion TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } } dependencies { - implementation "junit:junit:$JUNIT_VERSION" + implementation libs.junit implementation project(":annotation:ksp") - implementation "com.github.tschuchortdev:kotlin-compile-testing-ksp:${KOTLIN_COMPILE_TESTING_VERSION}" - implementation "com.google.truth:truth:${TRUTH_VERSION}" + implementation libs.ksp.compiletesting + implementation libs.truth testImplementation project(":annotation:ksp") testImplementation project(":annotation") testImplementation project(":glide") - testImplementation "org.jetbrains.kotlin:kotlin-test:${JETBRAINS_KOTLIN_TEST_VERSION}" + testImplementation libs.kotlin.test } \ No newline at end of file diff --git a/benchmark/build.gradle b/benchmark/build.gradle index 0eedc157d2..e5022d06ee 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle @@ -4,7 +4,8 @@ plugins { } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() + buildToolsVersion "30.0.3" compileOptions { @@ -14,7 +15,7 @@ android { defaultConfig { minSdk 19 - targetSdk TARGET_SDK_VERSION as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName "1.0" @@ -32,12 +33,12 @@ android { } dependencies { - androidTestImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" - androidTestImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - androidTestImplementation "junit:junit:{$JUNIT_VERSION}" + androidTestImplementation libs.androidx.test.runner + androidTestImplementation libs.androidx.junit + androidTestImplementation libs.junit androidTestImplementation project(':library') androidTestImplementation project(':testutil') - androidTestImplementation "androidx.benchmark:benchmark-junit4:${ANDROID_X_BENCHMARK_VERSION}" - androidTestImplementation "com.google.guava:guava:${GUAVA_VERSION}" + androidTestImplementation libs.androidx.benchmark.junit + androidTestImplementation libs.guava } \ No newline at end of file diff --git a/build.gradle b/build.gradle index b80b4b3768..048c15c1e1 100644 --- a/build.gradle +++ b/build.gradle @@ -9,17 +9,17 @@ buildscript { } dependencies { - classpath "com.android.tools.build:gradle:$ANDROID_GRADLE_VERSION" + classpath libs.android.gradle if (!hasProperty('DISABLE_ERROR_PRONE')) { - classpath "net.ltgt.gradle:gradle-errorprone-plugin:$ERROR_PRONE_PLUGIN_VERSION" + classpath libs.errorprone.gradle } - classpath 'com.guardsquare:proguard-gradle:7.1.0' - classpath "se.bjurr.violations:violations-gradle-plugin:$VIOLATIONS_PLUGIN_VERSION" - classpath "androidx.benchmark:benchmark-gradle-plugin:$ANDROID_X_BENCHMARK_VERSION" - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$JETBRAINS_KOTLIN_VERSION" - classpath "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:$KSP_GRADLE_PLUGIN_VERSION" - classpath "org.jetbrains.kotlinx:binary-compatibility-validator:$JETBRAINS_KOTLINX_BINARY_COMPATIBILITY_VALIDATOR_VERSION" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:$JETBRAINS_DOKKA_VERSION" + classpath libs.proguard.gradle + classpath libs.violations + classpath libs.androidx.benchmark.gradle + classpath libs.kotlin.gradle + classpath libs.ksp.gradle + classpath libs.coroutines.binarycompat.gradle + classpath libs.dokka.gradle } } diff --git a/gradle.properties b/gradle.properties index 7915f6fc9c..fe3862769c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -40,76 +40,8 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xmx4096M TEST_JVM_MEMORY_SIZE=4096M -## Glide versioning +## Glide versioning - these may be overwritten in lower level gradle.properties files VERSION_MAJOR=4 VERSION_MINOR=16 VERSION_PATCH=0 -VERSION_NAME=4.16.0-SNAPSHOT - -## SDK versioning -COMPILE_SDK_VERSION=33 -MIN_SDK_VERSION=14 -OK_HTTP_4_MIN_SDK_VERSION=21 -TARGET_SDK_VERSION=32 - -## AndroidX versions -ANDROID_X_ANNOTATION_VERSION=1.3.0 -ANDROID_X_APPCOMPAT_VERSION=1.3.1 -ANDROID_X_BENCHMARK_VERSION=1.1.0 -ANDROID_X_CARDVIEW_VERSION=1.0.0 -ANDROID_X_COMPOSE_VERSION=1.3.2 -ANDROID_X_COMPOSE_FOUNDATION_VERSION=1.3.1 -ANDROID_X_COMPOSE_MATERIAL_VERSION=1.3.1 -ANDROID_X_CONCURRENT_FUTURES_VERSION=1.1.0 -ANDROID_X_CORE_VERSION=1.6.0 -ANDROID_X_EXIF_INTERFACE_VERSION=1.3.3 -# At least versions 1.5 and later require java 8 desugaring, which Glide can't -# currently use, so we're stuck on an older version. -ANDROID_X_FRAGMENT_VERSION=1.3.6 -ANDROID_X_RECYCLERVIEW_VERSION=1.2.1 -ANDROID_X_TEST_CORE_VERSION=1.4.0 -ANDROID_X_TEST_ESPRESSO_VERSION=3.4.0 -ANDROID_X_TEST_JUNIT_VERSION=1.1.3 -ANDROID_X_TEST_RULES_VERSION=1.4.0 -ANDROID_X_TEST_RUNNER_VERSION=1.4.0 -ANDROID_X_TEST_CORE_KTX_VERSION=1.4.0 -ANDROID_X_TEST_JUNIT_KTX_VERSION=1.1.3 -ANDROID_X_TRACING_VERSION=1.0.0 -ANDROID_X_VECTOR_DRAWABLE_ANIMATED_VERSION=1.1.0 -ANDROID_X_CORE_KTX_VERSION=1.8.0 -ANDROID_X_LIFECYCLE_KTX_VERSION=2.4.1 - -ANDROID_SUPPORT_MULTIDEX_VERSION=1.0.3 - -# org.jetbrains versions -JETBRAINS_KOTLINX_COROUTINES_VERSION=1.6.4 -JETBRAINS_KOTLINX_COROUTINES_TEST_VERSION=1.6.4 -JETBRAINS_KOTLIN_VERSION=1.7.0 -JETBRAINS_KOTLIN_TEST_VERSION=1.7.0 -JETBRAINS_KOTLINX_BINARY_COMPATIBILITY_VALIDATOR_VERSION=0.11.0 -JETBRAINS_DOKKA_VERSION=1.7.10 - -## Other dependency versions -ACCOMPANIEST_VERSION=0.25.1 -ANDROID_GRADLE_VERSION=7.3.0 -AUTO_SERVICE_VERSION=1.0-rc3 -KOTLIN_COMPILE_TESTING_VERSION=1.4.9 -DAGGER_VERSION=2.15 -ERROR_PRONE_PLUGIN_VERSION=2.0.2 -ERROR_PRONE_VERSION=2.18.0 -GUAVA_TESTLIB_VERSION=18.0 -GUAVA_VERSION=28.1-android -JAVAPOET_VERSION=1.9.0 -JSR_305_VERSION=3.0.2 -JUNIT_VERSION=4.13.2 -KSP_GRADLE_PLUGIN_VERSION=1.7.0-1.0.6 -MOCKITO_ANDROID_VERSION=5.3.1 -MOCKITO_VERSION=5.3.1 -MOCKWEBSERVER_VERSION=3.0.0-RC1 -OK_HTTP_VERSION=3.10.0 -OK_HTTP_4_VERSION=4.10.0 -PMD_VERSION=6.0.0 -ROBOLECTRIC_VERSION=4.8.1 -TRUTH_VERSION=1.1.3 -VIOLATIONS_PLUGIN_VERSION=1.8 -VOLLEY_VERSION=1.2.0 +VERSION_NAME=4.16.0-SNAPSHOT \ No newline at end of file diff --git a/instrumentation/build.gradle b/instrumentation/build.gradle index b3fdc67172..e9d692a3e8 100644 --- a/instrumentation/build.gradle +++ b/instrumentation/build.gradle @@ -8,34 +8,34 @@ apply plugin: 'com.android.application' dependencies { annotationProcessor project(":annotation:compiler") implementation project(":library") - implementation "com.android.support:multidex:$ANDROID_SUPPORT_MULTIDEX_VERSION" - implementation "androidx.appcompat:appcompat:$ANDROID_X_APPCOMPAT_VERSION" + implementation libs.android.support.multidex + implementation libs.androidx.appcompat androidTestImplementation project(':library') androidTestImplementation project(':mocks') androidTestImplementation project(':testutil') - androidTestImplementation "org.mockito:mockito-android:$MOCKITO_ANDROID_VERSION" - androidTestImplementation "androidx.test.ext:junit:$ANDROID_X_TEST_JUNIT_VERSION" - androidTestImplementation "androidx.test:rules:$ANDROID_X_TEST_RULES_VERSION" - androidTestImplementation "androidx.test:core:$ANDROID_X_TEST_CORE_VERSION" - androidTestImplementation "androidx.test.espresso.idling:idling-concurrent:$ANDROID_X_TEST_ESPRESSO_VERSION" - androidTestImplementation "androidx.test.espresso:espresso-core:$ANDROID_X_TEST_ESPRESSO_VERSION" - androidTestImplementation "com.google.truth:truth:$TRUTH_VERSION" - androidTestImplementation "junit:junit:$JUNIT_VERSION" - androidTestImplementation "androidx.exifinterface:exifinterface:$ANDROID_X_EXIF_INTERFACE_VERSION" + androidTestImplementation libs.mockito.android + androidTestImplementation libs.androidx.junit + androidTestImplementation libs.androidx.test.rules + androidTestImplementation libs.androidx.test.core + androidTestImplementation libs.androidx.espresso.idling + androidTestImplementation libs.androidx.espresso + androidTestImplementation libs.truth + androidTestImplementation libs.junit + androidTestImplementation libs.androidx.exifinterface // Not totally clear why this is required, but it seems to be missing when tests are run on // 4.1.2 and 4.2.0 emulators. - androidTestImplementation "com.google.code.findbugs:jsr305:$JSR_305_VERSION" + androidTestImplementation libs.findbugs.jsr305 } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId 'com.bumptech.glide.instrumentation' - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName '1.0' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/integration/avif/build.gradle b/integration/avif/build.gradle index 35c09a65bd..ff5209519b 100644 --- a/integration/avif/build.gradle +++ b/integration/avif/build.gradle @@ -3,17 +3,17 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') implementation 'org.aomedia.avif.android:avif:0.11.1.3c786d2' - implementation "com.google.guava:guava:${GUAVA_VERSION}" + implementation libs.guava annotationProcessor project(':annotation:compiler') } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/compose/build.gradle b/integration/compose/build.gradle index 89480bfd7f..8f32dd384e 100644 --- a/integration/compose/build.gradle +++ b/integration/compose/build.gradle @@ -50,19 +50,19 @@ dependencies { implementation(project(':integration:recyclerview')) { transitive = false } - implementation "androidx.compose.foundation:foundation:$ANDROID_X_COMPOSE_FOUNDATION_VERSION" - implementation "androidx.compose.ui:ui:$ANDROID_X_COMPOSE_VERSION" - implementation "com.google.accompanist:accompanist-drawablepainter:$ACCOMPANIEST_VERSION" - implementation "androidx.core:core-ktx:$ANDROID_X_CORE_KTX_VERSION" - debugImplementation "androidx.compose.ui:ui-test-manifest:$ANDROID_X_COMPOSE_VERSION" - androidTestImplementation "junit:junit:$JUNIT_VERSION" - androidTestImplementation "androidx.compose.ui:ui-test-junit4:$ANDROID_X_COMPOSE_VERSION" - androidTestImplementation "androidx.test.espresso:espresso-core:$ANDROID_X_TEST_ESPRESSO_VERSION" - androidTestImplementation "androidx.test.espresso.idling:idling-concurrent:$ANDROID_X_TEST_ESPRESSO_VERSION" - androidTestImplementation "androidx.test.ext:junit:$ANDROID_X_TEST_JUNIT_VERSION" - androidTestImplementation "androidx.compose.material:material:$ANDROID_X_COMPOSE_MATERIAL_VERSION" + implementation libs.compose.foundation + implementation libs.compose.ui + implementation libs.drawablepainter + implementation libs.androidx.core.ktx + debugImplementation libs.compose.ui.testmanifest + androidTestImplementation libs.junit + androidTestImplementation libs.compose.ui.testjunit4 + androidTestImplementation libs.androidx.espresso + androidTestImplementation libs.androidx.espresso.idling + androidTestImplementation libs.androidx.junit + androidTestImplementation libs.compose.material + androidTestImplementation libs.truth androidTestImplementation project(':testutil') - androidTestImplementation "com.google.truth:truth:${TRUTH_VERSION}" } apply from: "${rootProject.projectDir}/scripts/upload.gradle" diff --git a/integration/concurrent/build.gradle b/integration/concurrent/build.gradle index fbcf2118ca..4b165aeab8 100644 --- a/integration/concurrent/build.gradle +++ b/integration/concurrent/build.gradle @@ -2,23 +2,23 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') - implementation "com.google.guava:guava:${GUAVA_VERSION}" - implementation "androidx.concurrent:concurrent-futures:${ANDROID_X_CONCURRENT_FUTURES_VERSION}" + implementation libs.guava + implementation libs.androidx.futures testImplementation project(':mocks') testImplementation project(':testutil') - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" + testImplementation libs.androidx.test.core + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.robolectric } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName = VERSION_NAME as String } diff --git a/integration/cronet/build.gradle b/integration/cronet/build.gradle index 77431dd2f1..2cf3ac755b 100644 --- a/integration/cronet/build.gradle +++ b/integration/cronet/build.gradle @@ -2,25 +2,25 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') - implementation 'com.google.android.gms:play-services-cronet:17.0.0' - implementation "com.google.guava:guava:${GUAVA_VERSION}" + implementation libs.cronet + implementation libs.guava implementation project(':annotation') annotationProcessor project(':annotation:compiler') - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + api libs.androidx.annotation - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.robolectric + testImplementation libs.mockito } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { minSdk 16 as int - targetSdk TARGET_SDK_VERSION as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/gifencoder/build.gradle b/integration/gifencoder/build.gradle index ca9543beea..ece4e4a913 100644 --- a/integration/gifencoder/build.gradle +++ b/integration/gifencoder/build.gradle @@ -4,17 +4,17 @@ dependencies { implementation project(':library') testImplementation project(":testutil") - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - testImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric + testImplementation libs.androidx.test.core + testImplementation libs.androidx.junit + testImplementation libs.androidx.test.runner } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() sourceSets { main { @@ -23,8 +23,8 @@ android { } defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName = VERSION_NAME as String } diff --git a/integration/ktx/build.gradle b/integration/ktx/build.gradle index aa0ee75015..b90be75c4c 100644 --- a/integration/ktx/build.gradle +++ b/integration/ktx/build.gradle @@ -4,11 +4,11 @@ plugins { } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" @@ -40,18 +40,18 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { dependencies { api project(":library") - implementation "androidx.core:core-ktx:$ANDROID_X_CORE_KTX_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$JETBRAINS_KOTLINX_COROUTINES_VERSION" - testImplementation "androidx.test:core-ktx:$ANDROID_X_TEST_CORE_KTX_VERSION" - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$JETBRAINS_KOTLIN_VERSION" - testImplementation "androidx.test.ext:junit-ktx:$ANDROID_X_TEST_JUNIT_KTX_VERSION" - testImplementation "androidx.test.ext:junit:$ANDROID_X_TEST_JUNIT_VERSION" - testImplementation "org.robolectric:robolectric:$ROBOLECTRIC_VERSION" - testImplementation "androidx.test:runner:$ANDROID_X_TEST_RUNNER_VERSION" - testImplementation "junit:junit:$JUNIT_VERSION" - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$JETBRAINS_KOTLINX_COROUTINES_TEST_VERSION" - testImplementation "com.google.truth:truth:$TRUTH_VERSION" - androidTestImplementation "androidx.test.ext:junit:$ANDROID_X_TEST_JUNIT_VERSION" + implementation libs.androidx.core.ktx + implementation libs.coroutines.core + testImplementation libs.androidx.test.ktx + testImplementation libs.kotlin.junit + testImplementation libs.androidx.test.ktx.junit + testImplementation libs.androidx.junit + testImplementation libs.robolectric + testImplementation libs.androidx.test.runner + testImplementation libs.junit + testImplementation libs.coroutines.test + testImplementation libs.truth + androidTestImplementation libs.androidx.junit } apply from: "${rootProject.projectDir}/scripts/upload.gradle" diff --git a/integration/okhttp/build.gradle b/integration/okhttp/build.gradle index 2ad9df11fa..b3f71f8c19 100644 --- a/integration/okhttp/build.gradle +++ b/integration/okhttp/build.gradle @@ -4,16 +4,16 @@ dependencies { implementation project(':library') annotationProcessor project(':annotation:compiler') - api "com.squareup.okhttp:okhttp:2.7.5" - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + api libs.okhttp2 + api libs.androidx.annotation } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/okhttp3/build.gradle b/integration/okhttp3/build.gradle index 8d69f27b2b..c6e1e02721 100644 --- a/integration/okhttp3/build.gradle +++ b/integration/okhttp3/build.gradle @@ -4,16 +4,16 @@ dependencies { implementation project(':library') annotationProcessor project(':annotation:compiler') - api "com.squareup.okhttp3:okhttp:${OK_HTTP_VERSION}" - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + api libs.okhttp3 + api libs.androidx.annotation } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/okhttp4/build.gradle b/integration/okhttp4/build.gradle index 3ead9875b0..a9da17bb93 100644 --- a/integration/okhttp4/build.gradle +++ b/integration/okhttp4/build.gradle @@ -4,16 +4,16 @@ dependencies { implementation project(':library') annotationProcessor project(':annotation:compiler') - api "com.squareup.okhttp3:okhttp:${OK_HTTP_4_VERSION}" - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + api libs.okhttp4 + api libs.androidx.annotation } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk OK_HTTP_4_MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.okhttp.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/recyclerview/build.gradle b/integration/recyclerview/build.gradle index 3bb4ac4f25..e3d078a198 100644 --- a/integration/recyclerview/build.gradle +++ b/integration/recyclerview/build.gradle @@ -2,16 +2,16 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') - compileOnly "androidx.recyclerview:recyclerview:${ANDROID_X_RECYCLERVIEW_VERSION}" - compileOnly "androidx.fragment:fragment:${ANDROID_X_FRAGMENT_VERSION}" + compileOnly libs.androidx.recyclerview + compileOnly libs.androidx.fragment } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/integration/sqljournaldiskcache/build.gradle b/integration/sqljournaldiskcache/build.gradle index 224f825dcf..af44543f1e 100644 --- a/integration/sqljournaldiskcache/build.gradle +++ b/integration/sqljournaldiskcache/build.gradle @@ -4,11 +4,11 @@ plugins { } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } @@ -21,16 +21,16 @@ android { dependencies { implementation project(':library') - implementation "com.google.errorprone:error_prone_annotations:$ERROR_PRONE_VERSION" + implementation libs.errorprone.annotations - testImplementation "com.google.guava:guava-testlib:${GUAVA_TESTLIB_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - testImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" + testImplementation libs.guava.testlib + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric + testImplementation libs.androidx.test.core + testImplementation libs.androidx.junit + testImplementation libs.androidx.test.runner } apply from: "${rootProject.projectDir}/scripts/upload.gradle" diff --git a/integration/volley/build.gradle b/integration/volley/build.gradle index d0a9c3febb..8120eca2df 100644 --- a/integration/volley/build.gradle +++ b/integration/volley/build.gradle @@ -2,27 +2,27 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') - api "com.android.volley:volley:${VOLLEY_VERSION}" - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + api libs.volley + api libs.androidx.annotation annotationProcessor project(':annotation:compiler') testImplementation project(":testutil") - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "com.squareup.okhttp3:mockwebserver:${MOCKWEBSERVER_VERSION}" - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - testImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric + testImplementation libs.mockwebserver + testImplementation libs.androidx.test.core + testImplementation libs.androidx.junit + testImplementation libs.androidx.test.runner } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/library/build.gradle b/library/build.gradle index b3625fcd89..9c8bd6eabf 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -12,27 +12,27 @@ dependencies { api project(':third_party:gif_decoder') api project(':third_party:disklrucache') api project(':annotation') - api "androidx.fragment:fragment:${ANDROID_X_FRAGMENT_VERSION}" - api "androidx.vectordrawable:vectordrawable-animated:${ANDROID_X_VECTOR_DRAWABLE_ANIMATED_VERSION}" - api "androidx.exifinterface:exifinterface:${ANDROID_X_EXIF_INTERFACE_VERSION}" - api "androidx.tracing:tracing:${ANDROID_X_TRACING_VERSION}" - compileOnly "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" + api libs.androidx.fragment + api libs.androidx.vectordrawable + api libs.androidx.exifinterface + api libs.androidx.tracing + compileOnly libs.androidx.appcompat if (project.plugins.hasPlugin('net.ltgt.errorprone')) { - errorprone "com.google.errorprone:error_prone_core:${ERROR_PRONE_VERSION}" + errorprone libs.errorprone.core } - testImplementation "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" + testImplementation libs.androidx.appcompat testImplementation project(':testutil') - testImplementation "com.google.guava:guava-testlib:${GUAVA_TESTLIB_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "com.squareup.okhttp3:mockwebserver:${MOCKWEBSERVER_VERSION}" - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - testImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" + testImplementation libs.guava.testlib + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric + testImplementation libs.mockwebserver + testImplementation libs.androidx.test.core + testImplementation libs.androidx.junit + testImplementation libs.androidx.test.runner } if (project.plugins.hasPlugin('net.ltgt.errorprone')) { @@ -59,11 +59,11 @@ if (project.plugins.hasPlugin('net.ltgt.errorprone')) { } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String consumerProguardFiles 'proguard-rules.txt' } diff --git a/library/pmd/build.gradle b/library/pmd/build.gradle index 3ef55b2ff2..05748e5bbd 100644 --- a/library/pmd/build.gradle +++ b/library/pmd/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'pmd' def library = project(':library') pmd { - toolVersion PMD_VERSION + toolVersion libs.versions.pmd.get() } tasks.create('pmd', Pmd) { diff --git a/library/test/build.gradle b/library/test/build.gradle index ec4ea82854..9a8b568c1d 100644 --- a/library/test/build.gradle +++ b/library/test/build.gradle @@ -1,19 +1,19 @@ apply plugin: 'com.android.library' dependencies { - testImplementation "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" + testImplementation libs.androidx.appcompat testImplementation project(':library') testImplementation project(':mocks') testImplementation project(':testutil') - testImplementation "com.google.guava:guava-testlib:${GUAVA_TESTLIB_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" - testImplementation "com.squareup.okhttp3:mockwebserver:${MOCKWEBSERVER_VERSION}" - testImplementation "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" - testImplementation "androidx.test.ext:junit:${ANDROID_X_TEST_JUNIT_VERSION}" - testImplementation "androidx.test:runner:${ANDROID_X_TEST_RUNNER_VERSION}" + testImplementation libs.guava.testlib + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric + testImplementation libs.mockwebserver + testImplementation libs.androidx.test.core + testImplementation libs.androidx.junit + testImplementation libs.androidx.test.runner } tasks.withType(JavaCompile) { @@ -40,11 +40,11 @@ android.testOptions.unitTests.all { Test testTask -> } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/mocks/build.gradle b/mocks/build.gradle index 329b5581f5..19d6e462a7 100644 --- a/mocks/build.gradle +++ b/mocks/build.gradle @@ -2,17 +2,17 @@ apply plugin: 'com.android.library' dependencies { implementation project(':library') - implementation "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" - implementation "com.google.guava:guava:${GUAVA_VERSION}" - implementation "org.mockito:mockito-core:${MOCKITO_VERSION}" + implementation libs.androidx.annotation + implementation libs.guava + implementation libs.mockito } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName = VERSION_NAME as String } diff --git a/samples/contacturi/build.gradle b/samples/contacturi/build.gradle index b76fb33b58..54c14954e5 100644 --- a/samples/contacturi/build.gradle +++ b/samples/contacturi/build.gradle @@ -2,17 +2,17 @@ apply plugin: 'com.android.application' dependencies { implementation project(':library') - implementation "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" + implementation libs.androidx.appcompat annotationProcessor project(':annotation:compiler') } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId 'com.bumptech.glide.samples.contacturi' - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName '1.0' diff --git a/samples/flickr/build.gradle b/samples/flickr/build.gradle index ad61f941d7..d78280f865 100644 --- a/samples/flickr/build.gradle +++ b/samples/flickr/build.gradle @@ -7,18 +7,18 @@ dependencies { } annotationProcessor project(':annotation:compiler') - implementation "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" - implementation "com.android.volley:volley:${VOLLEY_VERSION}" - implementation "androidx.recyclerview:recyclerview:${ANDROID_X_RECYCLERVIEW_VERSION}" + implementation libs.androidx.appcompat + implementation libs.volley + implementation libs.androidx.recyclerview } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId 'com.bumptech.glide.samples.flickr' - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName '1.0' diff --git a/samples/gallery/build.gradle b/samples/gallery/build.gradle index 875578ead9..6f439a6a36 100644 --- a/samples/gallery/build.gradle +++ b/samples/gallery/build.gradle @@ -10,14 +10,14 @@ dependencies { transitive = false } - implementation "androidx.recyclerview:recyclerview:$ANDROID_X_RECYCLERVIEW_VERSION" - implementation "androidx.fragment:fragment-ktx:$ANDROID_X_FRAGMENT_VERSION" - implementation "androidx.core:core-ktx:$ANDROID_X_CORE_KTX_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$JETBRAINS_KOTLINX_COROUTINES_VERSION" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$JETBRAINS_KOTLINX_COROUTINES_VERSION" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$JETBRAINS_KOTLIN_VERSION" - implementation "androidx.compose.foundation:foundation:$ANDROID_X_COMPOSE_FOUNDATION_VERSION" - implementation "androidx.compose.ui:ui:$ANDROID_X_COMPOSE_VERSION" + implementation libs.androidx.recyclerview + implementation libs.androidx.fragment.ktx + implementation libs.androidx.core.ktx + implementation libs.coroutines.core + implementation libs.coroutines.android + implementation libs.kotlin.jdk7 + implementation libs.compose.foundation + implementation libs.compose.ui ksp project(':annotation:ksp') } diff --git a/samples/giphy/build.gradle b/samples/giphy/build.gradle index 0f6f3b3e14..d58829317b 100644 --- a/samples/giphy/build.gradle +++ b/samples/giphy/build.gradle @@ -6,18 +6,18 @@ dependencies { transitive = false } implementation 'com.google.code.gson:gson:2.8.2' - implementation "androidx.recyclerview:recyclerview:${ANDROID_X_RECYCLERVIEW_VERSION}" - implementation "androidx.fragment:fragment:${ANDROID_X_FRAGMENT_VERSION}" + implementation libs.androidx.recyclerview + implementation libs.androidx.fragment annotationProcessor project(':annotation:compiler') } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId 'com.bumptech.glide.samples.giphy' - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName '1.0' } diff --git a/samples/imgur/build.gradle b/samples/imgur/build.gradle index 2f678528ef..466841de03 100644 --- a/samples/imgur/build.gradle +++ b/samples/imgur/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.application' android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId "com.bumptech.glide.samples.imgur" - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName "1.0" @@ -28,29 +28,29 @@ dependencies { implementation project(':library') annotationProcessor project(':annotation:compiler') - implementation "com.google.dagger:dagger:${DAGGER_VERSION}" - annotationProcessor "com.google.dagger:dagger-compiler:${DAGGER_VERSION}" - implementation "com.google.dagger:dagger-android:${DAGGER_VERSION}" - implementation ("com.google.dagger:dagger-android-support:${DAGGER_VERSION}") { + implementation libs.dagger + implementation libs.dagger.android + implementation (libs.dagger.android.support) { exclude group: "com.android.support" } - annotationProcessor "com.google.dagger:dagger-android-processor:${DAGGER_VERSION}" + annotationProcessor libs.dagger.compiler + annotationProcessor libs.dagger.android.processor - implementation "com.squareup.okhttp3:okhttp:${OK_HTTP_VERSION}" - implementation 'com.squareup.retrofit2:retrofit:2.3.0' - implementation 'com.squareup.retrofit2:converter-gson:2.3.0' - implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0' + implementation libs.okhttp3 + implementation libs.retrofit + implementation libs.retrofit.gson + implementation libs.retrofit.rxjava - implementation 'io.reactivex:rxandroid:1.2.1' - implementation 'io.reactivex:rxjava:1.3.4' + implementation libs.rx.android + implementation libs.rx.java - implementation "androidx.appcompat:appcompat:${ANDROID_X_APPCOMPAT_VERSION}" - implementation "androidx.cardview:cardview:${ANDROID_X_CARDVIEW_VERSION}" - implementation "androidx.recyclerview:recyclerview:${ANDROID_X_RECYCLERVIEW_VERSION}" + implementation libs.androidx.appcompat + implementation libs.androidx.cardview + implementation libs.androidx.recyclerview // Fixes a compilation warning related to dagger, see // https://github.com/google/guava/issues/2721. - compileOnly "com.google.errorprone:error_prone_annotations:${ERROR_PRONE_VERSION}" + compileOnly libs.errorprone.annotations } task run(type: Exec, dependsOn: 'installDebug') { diff --git a/samples/svg/build.gradle b/samples/svg/build.gradle index 0bf05d57c7..41a9d5738e 100644 --- a/samples/svg/build.gradle +++ b/samples/svg/build.gradle @@ -3,17 +3,17 @@ apply plugin: 'com.android.application' dependencies { implementation project(':library') annotationProcessor project(':annotation:compiler') - implementation 'com.caverock:androidsvg:1.2.1' - implementation "androidx.fragment:fragment:${ANDROID_X_FRAGMENT_VERSION}" + implementation libs.svg + implementation libs.androidx.fragment } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { applicationId 'com.bumptech.glide.samples.svg' - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionCode 1 versionName '1.0' diff --git a/settings.gradle b/settings.gradle index c4fe9a6083..a7528e0ef2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -39,3 +39,110 @@ include ':testutil' include ':mocks' rootProject.name = 'glide-parent' + +dependencyResolutionManagement { + // versionCatalogs end up in the global namespace and we can't nest namespaces, so we end up + // stuffing everything into libs :/. + versionCatalogs { + libs { + // Versions for things other than dependencies + version('compile-sdk-version', 'android-33') + version('min-sdk-version', '14') + version('okhttp-min-sdk-version', '21') + version('target-sdk-version', '32') + version('pmd', '6.0.0') + + // Versions for dependencies + version('compose', '1.3.2') + version('coroutines', '1.6.4') + version('dagger', '2.15') + version('errorprone', '2.18.0') + version('kotlin', '1.7.0') + version('mockito', '5.3.1') + version('retrofit', '2.3.0') + version('androidx-benchmark', '1.1.0') + version('androidx-espresso', '3.4.0') + // At least versions 1.5 and later require java 8 desugaring, which Glide can't + // currently use, so we're stuck on an older version. + version('androidx-fragment', '1.3.6') + + library('android.support.multidex', "com.android.support:multidex:1.0.3") + library('autoservice', 'com.google.auto.service:auto-service:1.0-rc3') + library('autoservice.annotations', 'com.google.auto.service:auto-service-annotations:1.0.1') + library('android-gradle', 'com.android.tools.build:gradle:7.3.0') + library('androidx-cardview', 'androidx.cardview:cardview:1.0.0') + library('androidx-core', 'androidx.core:core:1.6.0') + library('androidx-annotation', 'androidx.annotation:annotation:1.3.0') + library('androidx-appcompat', 'androidx.appcompat:appcompat:1.3.1') + library('androidx-benchmark.gradle', 'androidx.benchmark', 'benchmark-gradle-plugin').versionRef('androidx-benchmark') + library('androidx-benchmark.junit', 'androidx.benchmark', 'benchmark-junit4').versionRef('androidx-benchmark') + library('androidx-core.ktx', 'androidx.core:core-ktx:1.8.0') + library('androidx-espresso', 'androidx.test.espresso', 'espresso-core').versionRef('androidx-espresso') + library('androidx-espresso.idling', 'androidx.test.espresso.idling', 'idling-concurrent').versionRef('androidx-espresso') + library('androidx-exifinterface', 'androidx.exifinterface:exifinterface:1.3.3') + library('androidx-fragment', 'androidx.fragment', 'fragment').versionRef('androidx-fragment') + library('androidx-fragment.ktx', 'androidx.fragment', 'fragment-ktx').versionRef('androidx-fragment') + library('androidx-futures', 'androidx.concurrent:concurrent-futures:1.1.0') + library('androidx-junit', 'androidx.test.ext:junit:1.1.3') + library('androidx-recyclerview','androidx.recyclerview:recyclerview:1.2.1') + library('androidx-test.core', 'androidx.test:core:1.4.0') + library('androidx-test.ktx', 'androidx.test:core-ktx:1.4.0') + library('androidx-test.ktx.junit', 'androidx.test.ext:junit-ktx:1.1.3') + library('androidx-test.rules', 'androidx.test:rules:1.4.0') + library('androidx-test.runner', 'androidx.test:runner:1.4.0') + library('androidx-tracing', 'androidx.tracing:tracing:1.0.0') + library('androidx.vectordrawable', 'androidx.vectordrawable:vectordrawable-animated:1.1.0') + library('proguard-gradle', 'com.guardsquare:proguard-gradle:7.1.0') + library('compose-foundation', 'androidx.compose.foundation:foundation:1.3.1') + library('compose-material', 'androidx.compose.material:material:1.3.1') + library('compose-ui', 'androidx.compose.ui', 'ui').versionRef('compose') + library('compose-ui.testmanifest', 'androidx.compose.ui', 'ui-test-manifest').versionRef('compose') + library('compose-ui.testjunit4', 'androidx.compose.ui', 'ui-test-junit4').versionRef('compose') + library('coroutines-binarycompat.gradle', 'org.jetbrains.kotlinx:binary-compatibility-validator:0.11.0') + library('coroutines-android', 'org.jetbrains.kotlinx', 'kotlinx-coroutines-android').versionRef('coroutines') + library('coroutines-core', 'org.jetbrains.kotlinx', 'kotlinx-coroutines-core').versionRef('coroutines') + library('coroutines-test', 'org.jetbrains.kotlinx', 'kotlinx-coroutines-test').versionRef('coroutines') + library('cronet', 'com.google.android.gms:play-services-cronet:17.0.0') + library('dagger', 'com.google.dagger', 'dagger').versionRef('dagger') + library('dagger-compiler', 'com.google.dagger', 'dagger-compiler').versionRef('dagger') + library('dagger-android', 'com.google.dagger', 'dagger-android').versionRef('dagger') + library('dagger-android.support', 'com.google.dagger', 'dagger-android-support').versionRef('dagger') + library('dagger-android.processor', 'com.google.dagger', 'dagger-android-processor').versionRef('dagger') + library('dokka-gradle', 'org.jetbrains.dokka:dokka-gradle-plugin:1.7.10') + library('drawablepainter', 'com.google.accompanist:accompanist-drawablepainter:0.25.1') + library('errorprone-annotations', 'com.google.errorprone', 'error_prone_annotations').versionRef('errorprone') + library('errorprone-core', 'com.google.errorprone', 'error_prone_core').versionRef('errorprone') + library('errorprone-gradle', 'net.ltgt.gradle:gradle-errorprone-plugin:2.0.2') + library('findbugs-jsr305', 'com.google.code.findbugs:jsr305:3.0.2') + library('guava', 'com.google.guava:guava:28.1-android') + library('guava-testlib', 'com.google.guava:guava-testlib:18.0') + library('javapoet', 'com.squareup:javapoet:1.9.0') + library('junit', 'junit:junit:4.13.2') + library('kotlin-junit', 'org.jetbrains.kotlin', 'kotlin-test-junit').versionRef('kotlin') + library('kotlin-jdk7', 'org.jetbrains.kotlin', 'kotlin-stdlib-jdk7').versionRef('kotlin') + library('kotlin-gradle', 'org.jetbrains.kotlin', 'kotlin-gradle-plugin').versionRef('kotlin') + library('kotlin-test', 'org.jetbrains.kotlin:kotlin-test:1.7.0') + library('kotlinpoet', 'com.squareup:kotlinpoet:1.12.0') + library('ksp', 'com.google.devtools.ksp:symbol-processing-api:1.7.0-1.0.6') + library('ksp-autoservice', 'dev.zacsweers.autoservice:auto-service-ksp:1.0.0') + library('ksp-compiletesting', 'com.github.tschuchortdev:kotlin-compile-testing-ksp:1.4.9') + library('ksp-gradle', 'com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.7.0-1.0.6') + library('mockwebserver', 'com.squareup.okhttp3:mockwebserver:3.0.0-RC1') + library('mockito', 'org.mockito', 'mockito-core').versionRef('mockito') + library('mockito-android', 'org.mockito', 'mockito-android').versionRef('mockito') + library('okhttp2', 'com.squareup.okhttp:okhttp:2.7.5') + library('okhttp3', 'com.squareup.okhttp3:okhttp:3.10.0') + library('okhttp4', 'com.squareup.okhttp3:okhttp:4.10.0') + library('retrofit', 'com.squareup.retrofit2', 'retrofit').versionRef('retrofit') + library('retrofit-gson', 'com.squareup.retrofit2', 'converter-gson').versionRef('retrofit') + library('retrofit-rxjava', 'com.squareup.retrofit2', 'adapter-rxjava').versionRef('retrofit') + library('robolectric', 'org.robolectric:robolectric:4.8.1') + library('rx-android', 'io.reactivex:rxandroid:1.2.1') + library('rx-java', 'io.reactivex:rxjava:1.3.4') + library('svg', 'com.caverock:androidsvg:1.2.1') + library('truth', 'com.google.truth:truth:1.1.3') + library('violations', 'se.bjurr.violations:violations-gradle-plugin:1.8') + library('volley', 'com.android.volley:volley:1.2.0') + } + } +} diff --git a/testutil/build.gradle b/testutil/build.gradle index e570898dc1..8cb2dcebb9 100644 --- a/testutil/build.gradle +++ b/testutil/build.gradle @@ -1,19 +1,19 @@ apply plugin: 'com.android.library' dependencies { - implementation "com.google.truth:truth:${TRUTH_VERSION}" + implementation libs.truth implementation project(":library") - api "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" - api "androidx.core:core:${ANDROID_X_CORE_VERSION}" - api "androidx.test:core:${ANDROID_X_TEST_CORE_VERSION}" + api libs.androidx.annotation + api libs.androidx.core + api libs.androidx.test.core } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String } diff --git a/third_party/disklrucache/build.gradle b/third_party/disklrucache/build.gradle index 923f99b3f9..baeeb3066d 100644 --- a/third_party/disklrucache/build.gradle +++ b/third_party/disklrucache/build.gradle @@ -6,16 +6,16 @@ checkstyle { } dependencies { - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" + testImplementation libs.junit + testImplementation libs.truth } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int versionName VERSION_NAME as String consumerProguardFiles 'proguard-rules.txt' } diff --git a/third_party/gif_decoder/build.gradle b/third_party/gif_decoder/build.gradle index fc783c776a..c3a4c55e90 100644 --- a/third_party/gif_decoder/build.gradle +++ b/third_party/gif_decoder/build.gradle @@ -1,22 +1,22 @@ apply plugin: 'com.android.library' dependencies { - implementation "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" + implementation libs.androidx.annotation testImplementation project(':testutil') - testImplementation "androidx.annotation:annotation:${ANDROID_X_ANNOTATION_VERSION}" - testImplementation "com.google.truth:truth:${TRUTH_VERSION}" - testImplementation "junit:junit:${JUNIT_VERSION}" - testImplementation "org.mockito:mockito-core:${MOCKITO_VERSION}" - testImplementation "org.robolectric:robolectric:${ROBOLECTRIC_VERSION}" + testImplementation libs.androidx.annotation + testImplementation libs.truth + testImplementation libs.junit + testImplementation libs.mockito + testImplementation libs.robolectric } android { - compileSdk COMPILE_SDK_VERSION as int + compileSdkVersion libs.versions.compile.sdk.version.get() defaultConfig { - minSdk MIN_SDK_VERSION as int - targetSdk TARGET_SDK_VERSION as int + minSdk libs.versions.min.sdk.version.get() as int + targetSdk libs.versions.target.sdk.version.get() as int } }