11apply plugin : ' com.android.library'
22
3- def DEFAULT_COMPILE_SDK_VERSION = 23
4- def DEFAULT_BUILD_TOOLS_VERSION = " 23.0.1 "
5- def DEFAULT_TARGET_SDK_VERSION = 23
3+ def safeExtGet ( prop , fallback ) {
4+ rootProject . ext . has(prop) ? rootProject . ext . get(prop) : fallback
5+ }
66
77android {
8- compileSdkVersion project. hasProperty(' compileSdkVersion' ) ? project. compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
9- buildToolsVersion project. hasProperty(' buildToolsVersion' ) ? project. buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
10-
8+ compileSdkVersion safeExtGet(' compileSdkVersion' , 23 )
9+ buildToolsVersion safeExtGet(' buildToolsVersion' , ' 23.0.1' )
1110
1211 defaultConfig {
13- minSdkVersion 16
14- targetSdkVersion project. hasProperty(' targetSdkVersion' ) ? project. targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
12+ minSdkVersion safeExtGet(' minSdkVersion' , 16 )
13+ targetSdkVersion safeExtGet(' targetSdkVersion' , 23 )
14+
1515 versionCode 1
1616 versionName " 1.0"
1717 ndk {
@@ -21,7 +21,7 @@ android {
2121}
2222
2323dependencies {
24- compile fileTree(include : [' *.jar' ], dir : ' libs' )
25- compile " com.android.support:appcompat-v7:23.0.1"
26- compile " com.facebook.react:react-native:+ "
24+ implementation fileTree(include : [' *.jar' ], dir : ' libs' )
25+ implementation " com.android.support:appcompat-v7:${ safeExtGet('supportLibVersion', ' 23.0.1') } "
26+ implementation " com.facebook.react:react-native:${ safeExtGet('reactNativeVersion', '+') } "
2727}
0 commit comments