Skip to content

Commit 71c0661

Browse files
committed
Made Android version settings overridable from the main project (better future compatibility)
1 parent a598939 commit 71c0661

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

android/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
def safeExtGet(prop, fallback) {
2+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3+
}
14

25
buildscript {
36
repositories {
@@ -12,12 +15,12 @@ buildscript {
1215
apply plugin: 'com.android.library'
1316

1417
android {
15-
compileSdkVersion 26
16-
buildToolsVersion "25.0.3"
18+
compileSdkVersion safeExtGet('compileSdkVersion', 26)
19+
buildToolsVersion safeExtGet('buildToolsVersion', "25.0.3")
1720

1821
defaultConfig {
19-
minSdkVersion 16
20-
targetSdkVersion 26
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
23+
targetSdkVersion safeExtGet('targetSdkVersion', 26)
2124
versionCode 1
2225
versionName "1.0"
2326
}

0 commit comments

Comments
 (0)