Selaa lähdekoodia

Merge pull request #129 from yeomann/patch-1

improvement way to get root SDK versions
Travis Nuttall 5 vuotta sitten
vanhempi
commit
c5632629f7
No account linked to committer's email address
1 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 9
    5
      android/build.gradle

+ 9
- 5
android/build.gradle Näytä tiedosto

@@ -1,5 +1,9 @@
1 1
 apply plugin: 'com.android.library'
2 2
 
3
+def safeExtGet(prop, fallback) {
4
+    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5
+}
6
+
3 7
 repositories {
4 8
     mavenCentral()
5 9
 }
@@ -14,11 +18,11 @@ buildscript {
14 18
 }
15 19
 
16 20
 android {
17
-    compileSdkVersion 23
18
-    buildToolsVersion "23.0.1"
21
+    compileSdkVersion safeExtGet('compileSdkVersion', 26)
22
+    buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
19 23
     defaultConfig {
20
-        minSdkVersion 16
21
-        targetSdkVersion 23
24
+        minSdkVersion safeExtGet('minSdkVersion', 16)
25
+        targetSdkVersion safeExtGet('targetSdkVersion', 26)
22 26
         versionCode 1
23 27
         versionName "1.0"
24 28
     }
@@ -33,7 +37,7 @@ android {
33 37
 }
34 38
 
35 39
 dependencies {
36
-    compile 'com.facebook.react:react-native:+'
40
+    compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
37 41
     //compile 'com.squareup.okhttp3:okhttp:+'
38 42
     //{RNFetchBlob_PRE_0.28_DEPDENDENCY}
39 43
 }