Skip to content

Commit 818f4ac

Browse files
authored
improved SDK values -use SDK Version values from root project
Instead of assuming the `compileSdkVersion `, `targetSdkVersion`, etc, we can make it dynamic by reading it from the root project. Android Target API Level 26 will be required in August 2018. https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html Therefore I wrote target values of 26 instead of 23 And the React Native team is already working on this: facebook/react-native#18095 facebook/react-native#17741
1 parent fb7f403 commit 818f4ac

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

android/build.gradle

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
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
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
8+
compileSdkVersion safeExtGet('compileSdkVersion', 26)
9+
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
610

711
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 23
12+
minSdkVersion safeExtGet('minSdkVersion', 16)
13+
targetSdkVersion safeExtGet('targetSdkVersion', 26)
14+
versionCode 1
15+
versionName "1.0"
1016
}
1117

1218
lintOptions {

0 commit comments

Comments
 (0)