From 196940778f99d59bc49218a5ea4ffebbcd1688e0 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 8 Oct 2020 00:22:12 +0530 Subject: [PATCH] build: extract all versions to ext Signed-off-by: Harsh Shandilya --- app/build.gradle | 16 ++++++++-------- build.gradle | 15 +++++++++++++-- lobsters-api/build.gradle | 9 +++------ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5113aebc..cdfee333 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -64,10 +64,10 @@ dependencies { implementation(project(":data")) implementation(project(":lobsters-api")) implementation(project(":model")) - implementation "androidx.core:core-ktx:1.5.0-alpha04" - implementation "androidx.activity:activity-ktx:1.2.0-beta01" - implementation "androidx.appcompat:appcompat:1.3.0-alpha02" - implementation "androidx.browser:browser:1.3.0-alpha06" + implementation "androidx.core:core-ktx:$core_version" + implementation "androidx.activity:activity-ktx:$activity_version" + implementation "androidx.appcompat:appcompat:$appcompat_version" + implementation "androidx.browser:browser:$browser_version" implementation "androidx.compose.foundation:foundation:$compose_version" implementation "androidx.compose.foundation:foundation-layout:$compose_version" implementation "androidx.compose.foundation:foundation-text:$compose_version" @@ -82,12 +82,12 @@ dependencies { implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" implementation "androidx.ui:ui-tooling:$compose_version" - implementation "com.google.android.material:material:1.3.0-alpha02" + implementation "com.google.android.material:material:$material_version" implementation "com.google.dagger:hilt-android:$hilt_dagger_version" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" - implementation "saschpe.android:customtabs:3.0.2" + implementation "saschpe.android:customtabs:$customtabs_version" androidTestImplementation "com.google.dagger:hilt-android-testing:$hilt_dagger_version" - testImplementation "junit:junit:4.13" + testImplementation "junit:junit:$junit_version" androidTestImplementation "androidx.ui:ui-test:$compose_version" - coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10" + coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:$desugar_version" } diff --git a/build.gradle b/build.gradle index 9130f2a1..a1dfa757 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,25 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { + activity_version = "1.2.0-beta01" + agp_version = "4.2.0-alpha13" + appcompat_version = "1.3.0-alpha02" + browser_version = "1.3.0-alpha06" compose_version = "1.0.0-alpha04" + core_version = "1.5.0-alpha04" coroutines_version = "1.3.9" + customtabs_version = "3.0.2" dagger_version = "2.29.1" + desugar_version = "1.0.10" hilt_androidx_version = "1.0.0-alpha02" hilt_dagger_version = "2.29.1-alpha" + junit_version = "4.13" kotlin_version = "1.4.10" lifecycle_version = "2.3.0-beta01" + material_version = "1.3.0-alpha03" moshi_version = "1.9.3" + okhttp_version = "3.14.9" + retrofit_version = "2.9.0" room_version = "2.3.0-alpha02" } repositories { @@ -16,7 +27,7 @@ buildscript { jcenter() } dependencies { - classpath "com.android.tools.build:gradle:4.2.0-alpha13" + classpath "com.android.tools.build:gradle:$agp_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_dagger_version" } @@ -63,7 +74,7 @@ subprojects { } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { kotlinOptions { - jvmTarget = "1.8" + jvmTarget = JavaVersion.VERSION_1_8 } } } diff --git a/lobsters-api/build.gradle b/lobsters-api/build.gradle index 8f3d6216..729edf39 100644 --- a/lobsters-api/build.gradle +++ b/lobsters-api/build.gradle @@ -3,15 +3,12 @@ plugins { } dependencies { - def moshi_version = "1.9.3" - def retrofit_version = "2.9.0" implementation project(":model") implementation "com.squareup.retrofit2:retrofit:$retrofit_version" implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version" kaptTest "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version" - testImplementation 'junit:junit:4.13' - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9" - // retrofit uses 3.14.9, so shall we. + testImplementation "junit:junit:$junit_version" + testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" //noinspection GradleDependency - testImplementation "com.squareup.okhttp3:mockwebserver:3.14.9" + testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp_version" }