Skip to content

Commit d91c5e8

Browse files
mgray2010browniefed
authored andcommitted
Support Overwritting Gradle Values (#249)
1 parent df61308 commit d91c5e8

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

android/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ buildscript {
1010

1111
apply plugin: 'com.android.library'
1212

13+
def safeExtGet(prop, fallback) {
14+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15+
}
16+
1317
android {
14-
compileSdkVersion 26
15-
buildToolsVersion "26.0.1"
18+
compileSdkVersion safeExtGet("compileSdkVersion", 26)
19+
buildToolsVersion safeExtGet("buildToolsVersion", "26.0.1")
1620

1721
defaultConfig {
18-
minSdkVersion 16
19-
targetSdkVersion 22
22+
minSdkVersion safeExtGet("minSdkVersion", 16)
23+
targetSdkVersion safeExtGet("targetSdkVersion", 22)
2024
versionCode 1
2125
versionName "1.0"
2226
}

0 commit comments

Comments
 (0)