From df453a19d542906c894e8499b29eb65478de24a0 Mon Sep 17 00:00:00 2001 From: Paul-Louis NECH Date: Sun, 17 Feb 2019 18:03:47 +0100 Subject: [PATCH] chore: Use gradle variables --- app/build.gradle | 22 ++++++++++++++-------- build.gradle | 4 ++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 8cbce62..f123956 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -39,10 +39,15 @@ android { } } +ext { + roomVersion = '1.1.1' + archLifecycleVersion = '1.1.1' +} + dependencies { // region Kotlin - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - kapt "android.arch.lifecycle:compiler:1.1.1" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" + kapt "android.arch.lifecycle:compiler:$archLifecycleVersion" // endregion // region Support Library @@ -52,17 +57,18 @@ dependencies { // endregion // region ViewModel and LiveData - implementation "android.arch.lifecycle:extensions:1.1.1" + implementation "android.arch.lifecycle:extensions:$archLifecycleVersion" + kapt "android.arch.lifecycle:compiler:$archLifecycleVersion" // alternatively, just ViewModel - //implementation "android.arch.lifecycle:viewmodel:1.1.0" + //implementation "android.arch.lifecycle:viewmodel:$archLifecycleVersion" // alternatively, just LiveData - //implementation "android.arch.lifecycle:livedata:1.1.0" + //implementation "android.arch.lifecycle:livedata:$archLifecycleVersion" // endregion // region Jetpack / Developer Experience // Room - implementation "android.arch.persistence.room:runtime:1.1.1" - kapt "android.arch.persistence.room:compiler:1.1.1" + implementation "android.arch.persistence.room:runtime:$roomVersion" + kapt "android.arch.persistence.room:compiler:$roomVersion" // Paging implementation "android.arch.paging:runtime:1.0.1" @@ -79,6 +85,6 @@ dependencies { testImplementation "android.arch.core:core-testing:1.1.1" // Test helpers for Room - testImplementation "android.arch.persistence.room:testing:1.1.1" + testImplementation "android.arch.persistence.room:testing:$roomVersion" // endregion } diff --git a/build.gradle b/build.gradle index f478256..db1c952 100644 --- a/build.gradle +++ b/build.gradle @@ -18,14 +18,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.0' + ext.kotlinVersion = '1.3.0' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files -- libgit2 0.27.0