diff --git a/android/build.gradle b/android/build.gradle index 3faae89..52caca9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,3 +1,4 @@ +apply plugin: 'com.android.library' buildscript { repositories { @@ -9,15 +10,22 @@ buildscript { } } -apply plugin: 'com.android.library' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + +def DEFAULT_COMPILE_SDK_VERSION = 23 +def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1" +def DEFAULT_MIN_SDK_VERSION = 16 +def DEFAULT_TARGET_SDK_VERSION = 22 android { - compileSdkVersion 23 - buildToolsVersion "23.0.1" + compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) + buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) defaultConfig { - minSdkVersion 16 - targetSdkVersion 22 + minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) + targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) versionCode 1 versionName "1.0" } @@ -31,5 +39,5 @@ repositories { } dependencies { - compile 'com.facebook.react:react-native:+' + implementation 'com.facebook.react:react-native:+' }