diff --git a/android/build.gradle b/android/build.gradle index d68693bf1..184835289 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,9 @@ apply plugin: 'com.android.library' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + repositories { mavenCentral() } @@ -14,11 +18,11 @@ buildscript { } android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion safeExtGet('compileSdkVersion', 26) + buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3') defaultConfig { - minSdkVersion 16 - targetSdkVersion 23 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 26) versionCode 1 versionName "1.0" } @@ -33,7 +37,7 @@ android { } dependencies { - compile 'com.facebook.react:react-native:+' + compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}" //compile 'com.squareup.okhttp3:okhttp:+' //{RNFetchBlob_PRE_0.28_DEPDENDENCY} }