Skip to content

Commit 51ee0a7

Browse files
committed
Using SDK Version variables from root project
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project. Default `compileSdkVersion` and `targetSdkVersion` to the latest versions. Android Target API Level 26 will be required in August 2018. https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html And the React Native team is already working on this: facebook/react-native#17741 facebook/react-native#18095
1 parent 1fb974f commit 51ee0a7

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

android/build.gradle

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,21 @@ buildscript {
1313
}
1414
}
1515

16+
def _ext = rootProject.ext
17+
18+
def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+'
19+
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 27
20+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '27.0.3'
21+
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16
22+
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 27
23+
1624
android {
17-
compileSdkVersion 23
18-
buildToolsVersion "23.0.1"
25+
compileSdkVersion _compileSdkVersion
26+
buildToolsVersion _buildToolsVersion
27+
1928
defaultConfig {
20-
minSdkVersion 16
21-
targetSdkVersion 23
29+
minSdkVersion _minSdkVersion
30+
targetSdkVersion _targetSdkVersion
2231
versionCode 1
2332
versionName "1.0"
2433
}
@@ -33,6 +42,7 @@ android {
3342
}
3443

3544
dependencies {
36-
compile 'com.facebook.react:react-native:+'
45+
//noinspection GradleDynamicVersion
46+
compile "com.facebook.react:react-native:${_reactNativeVersion}"
3747
//{RNFetchBlob_PRE_0.28_DEPDENDENCY}
3848
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed May 18 12:33:41 CST 2016
1+
#Tue Apr 24 14:22:15 BRT 2018
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 commit comments

Comments
 (0)