We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 982bce5 + 678402f commit 269866aCopy full SHA for 269866a
android/build.gradle
@@ -3,16 +3,20 @@ apply plugin: 'com.android.library'
3
import groovy.json.JsonSlurper
4
5
android {
6
- compileSdkVersion 28
+ compileSdkVersion safeExtGet('compileSdkVersion', 28)
7
8
defaultConfig {
9
- minSdkVersion 16
10
- targetSdkVersion 28
+ minSdkVersion safeExtGet('minSdkVersion', 16)
+ targetSdkVersion safeExtGet('compileSdkVersion', 28)
11
12
buildConfigField("String", "MODULE_VERSION", "\"${getModuleVersion()}\"")
13
}
14
15
16
+def safeExtGet(prop, fallback) {
17
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
18
+}
19
+
20
def getModuleVersion() {
21
def jsonFile = file('../package.json')
22
def parsedJson = new JsonSlurper().parseText(jsonFile.text)
0 commit comments