Skip to content
This repository was archived by the owner on Oct 20, 2020. It is now read-only.

Commit 959d1ed

Browse files
committed
Update build.gradle to allow rootProject overrides of versions
1 parent 6b034af commit 959d1ed

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

android/build.gradle

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
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', 23)
9+
buildToolsVersion safeExtGet('buildToolsVersion', "23.0.1")
610

711
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 22
12+
minSdkVersion safeExtGet('minSdkVersion', 16)
13+
targetSdkVersion safeExtGet('targetSdkVersion', 22)
1014
versionCode 1
1115
versionName "0.0.1"
1216
}
1317
}
1418

1519
dependencies {
16-
compile 'com.facebook.react:react-native:+'
17-
compile 'com.anjlab.android.iab.v3:library:1.0.44'
20+
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
21+
compile "com.anjlab.android.iab.v3:library:${safeExtGet('anjlabIABVersion', '1.0.44')}"
1822
}

0 commit comments

Comments
 (0)