From 95b20b486df9b60f5ae0c9b5d83b2e5c08478fa7 Mon Sep 17 00:00:00 2001 From: Egor Berdnikov Date: Sat, 14 Jan 2017 21:44:28 +0100 Subject: [PATCH] Move all dependencies to standalone file. This allows better and easier versioning management across modules Signed-off-by: Yahor Berdnikau --- .gitignore | 2 ++ build.gradle | 6 +++++- dependencies.gradle | 18 ++++++++++++++++++ library/build.gradle | 10 +++++----- menudrawer/build.gradle | 8 ++++---- pulltorefresh/build.gradle | 8 ++++---- ultrasonic/build.gradle | 8 ++++---- 7 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 dependencies.gradle diff --git a/.gitignore b/.gitignore index c6cbe562..054a0020 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ /local.properties /.idea/workspace.xml /.idea/libraries +/.idea/encodings.xml +/.idea/misc.xml .DS_Store /build /captures diff --git a/build.gradle b/build.gradle index 88d246d4..a7c6c440 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply from: 'dependencies.gradle' + buildscript { + apply from: 'dependencies.gradle' + repositories { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.3' + classpath gradlePlugins.androidTools } } diff --git a/dependencies.gradle b/dependencies.gradle new file mode 100644 index 00000000..219922c2 --- /dev/null +++ b/dependencies.gradle @@ -0,0 +1,18 @@ +ext.versions = [ + minSdk : 14, + targetSdk : 19, + compileSdk : 19, + + buildTools : "23.0.3", + androidTools : "1.2.3", + + androidSupport : "18.0.0", +] + +ext.gradlePlugins = [ + androidTools : "com.android.tools.build:gradle:$versions.androidTools" +] + +ext.androidSupport = [ + support : "com.android.support:support-v4:$versions.androidSupport" +] \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index d9c664d2..c0fac0ff 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 19 - buildToolsVersion "23.0.3" + compileSdkVersion versions.compileSdk + buildToolsVersion versions.buildTools defaultConfig { - minSdkVersion 7 - targetSdkVersion 19 + minSdkVersion versions.minSdk + targetSdkVersion versions.targetSdk } buildTypes { @@ -18,5 +18,5 @@ android { } dependencies { - compile 'com.android.support:support-v4:18.0.0' + compile androidSupport.support } diff --git a/menudrawer/build.gradle b/menudrawer/build.gradle index 70a74c2c..1670670d 100644 --- a/menudrawer/build.gradle +++ b/menudrawer/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 19 - buildToolsVersion "23.0.3" + compileSdkVersion versions.compileSdk + buildToolsVersion versions.buildTools defaultConfig { - minSdkVersion 7 - targetSdkVersion 19 + minSdkVersion versions.minSdk + targetSdkVersion versions.targetSdk } buildTypes { diff --git a/pulltorefresh/build.gradle b/pulltorefresh/build.gradle index 70a74c2c..1670670d 100644 --- a/pulltorefresh/build.gradle +++ b/pulltorefresh/build.gradle @@ -1,12 +1,12 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 19 - buildToolsVersion "23.0.3" + compileSdkVersion versions.compileSdk + buildToolsVersion versions.buildTools defaultConfig { - minSdkVersion 7 - targetSdkVersion 19 + minSdkVersion versions.minSdk + targetSdkVersion versions.targetSdk } buildTypes { diff --git a/ultrasonic/build.gradle b/ultrasonic/build.gradle index 154952b9..5287aeb9 100644 --- a/ultrasonic/build.gradle +++ b/ultrasonic/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 19 - buildToolsVersion "23.0.3" + compileSdkVersion versions.compileSdk + buildToolsVersion versions.buildTools defaultConfig { applicationId "org.moire.ultrasonic" - minSdkVersion 14 - targetSdkVersion 19 + minSdkVersion versions.minSdk + targetSdkVersion versions.targetSdk } buildTypes {