From 2fa7e777d6dcac5a70e3f343454a74b79609e6c0 Mon Sep 17 00:00:00 2001 From: Lyubo Marinov Date: Tue, 20 Jun 2017 10:32:44 -0500 Subject: [PATCH] Speed `react-native run-android` up --- android/app/build.gradle | 3 +-- android/build.gradle | 19 +++++++++++++++++-- .../gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ea9cdd46b..1afce14d9 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -37,6 +37,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - debugCompile project(path: ':sdk', configuration: 'debug') - releaseCompile project(path: ':sdk', configuration: 'release') + implementation project(':sdk') } diff --git a/android/build.gradle b/android/build.gradle index 98d1c8c1a..85d786fe0 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -4,9 +4,10 @@ buildscript { repositories { jcenter() + maven { url 'https://maven.google.com' } } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:3.+' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files. @@ -27,7 +28,21 @@ allprojects { ext { compileSdkVersion = 23 - buildToolsVersion = "23.0.1" + buildToolsVersion = "25.0.3" minSdkVersion = 16 targetSdkVersion = 22 } + +// Force the version of the Android build tools we have chosen on all +// subprojects. The forcing was introduced for react-native and the third-party +// modules that we utilize such as react-native-background-timer. +subprojects { subproject -> + afterEvaluate{ + if (subproject.plugins.hasPlugin('android') + || subproject.plugins.hasPlugin('android-library')) { + android { + buildToolsVersion rootProject.ext.buildToolsVersion + } + } + } +} diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index dbdc05d27..16c3fd696 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip