Skip to content

Commit 71cbf77

Browse files
authored
Fix for clobbering of rootProject compileSdkVersion, etc (#203)
1 parent ea75cf9 commit 71cbf77

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

android/build.gradle

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
11

22
buildscript {
3-
rootProject.ext {
4-
buildToolsVersion = "28.0.3"
5-
minSdkVersion = 16
6-
compileSdkVersion = 28
7-
targetSdkVersion = 28
8-
supportLibVersion = "28.0.0"
9-
}
103
repositories {
114
google()
125
jcenter()
@@ -19,22 +12,22 @@ buildscript {
1912
}
2013
}
2114

15+
def safeExtGet(prop, fallback) {
16+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17+
}
2218

2319
apply plugin: 'com.android.library'
2420

2521
android {
26-
compileSdkVersion rootProject.ext.compileSdkVersion
22+
compileSdkVersion safeExtGet('compileSdkVersion', 28)
2723
compileOptions {
2824
sourceCompatibility JavaVersion.VERSION_1_8
2925
targetCompatibility JavaVersion.VERSION_1_8
3026
}
3127

32-
compileSdkVersion 26
33-
compileSdkVersion rootProject.ext.compileSdkVersion
34-
3528
defaultConfig {
36-
minSdkVersion rootProject.ext.minSdkVersion
37-
targetSdkVersion rootProject.ext.targetSdkVersion
29+
minSdkVersion safeExtGet('minSdkVersion', 16)
30+
targetSdkVersion safeExtGet('targetSdkVersion', 28)
3831
versionCode 1
3932
versionName "1.0"
4033
ndk {

0 commit comments

Comments
 (0)