Skip to content

Commit c563262

Browse files
authored
Merge pull request #129 from yeomann/patch-1
improvement way to get root SDK versions
2 parents 1663c7b + 840ddce commit c563262

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

android/build.gradle

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
apply plugin: 'com.android.library'
22

3+
def safeExtGet(prop, fallback) {
4+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5+
}
6+
37
repositories {
48
mavenCentral()
59
}
@@ -14,11 +18,11 @@ buildscript {
1418
}
1519

1620
android {
17-
compileSdkVersion 23
18-
buildToolsVersion "23.0.1"
21+
compileSdkVersion safeExtGet('compileSdkVersion', 26)
22+
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
1923
defaultConfig {
20-
minSdkVersion 16
21-
targetSdkVersion 23
24+
minSdkVersion safeExtGet('minSdkVersion', 16)
25+
targetSdkVersion safeExtGet('targetSdkVersion', 26)
2226
versionCode 1
2327
versionName "1.0"
2428
}
@@ -33,7 +37,7 @@ android {
3337
}
3438

3539
dependencies {
36-
compile 'com.facebook.react:react-native:+'
40+
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
3741
//compile 'com.squareup.okhttp3:okhttp:+'
3842
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
3943
}

0 commit comments

Comments
 (0)