From 68424adc39e608243fadeb9ea97cf0095f90458e Mon Sep 17 00:00:00 2001 From: Guillaume Duveau Date: Wed, 5 Dec 2018 08:19:35 +0100 Subject: [PATCH] Support project-wide properties, replace deprecated configuration (#41) --- android/build.gradle | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 101b4e07..392a39a9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -14,13 +14,17 @@ buildscript { apply plugin: 'com.android.library' apply plugin: 'maven' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + android { - compileSdkVersion 26 - buildToolsVersion "26.0.3" + compileSdkVersion safeExtGet('compileSdkVersion', 26) + buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3') defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 22) versionCode 1 versionName "1.0" } @@ -40,8 +44,8 @@ repositories { } dependencies { - compile 'com.facebook.react:react-native:+' - compile 'com.android.support:appcompat-v7:26.+' + implementation 'com.facebook.react:react-native:+' + implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '26.+')}" } def configureReactNativePom(def pom) {