Skip to content

Commit a6feaab

Browse files
author
James Pearson
committed
Allow the override of compileSdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion
1 parent d2a5c3b commit a6feaab

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

android/build.gradle

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
apply plugin: 'com.android.library'
22

3+
4+
def safeExtGet(prop, fallback) {
5+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
6+
}
7+
8+
39
android {
4-
compileSdkVersion 23
5-
buildToolsVersion "23.0.1"
10+
compileSdkVersion safeExtGet("compileSdkVersion", 23)
11+
buildToolsVersion safeExtGet("buildToolsVersion", "23.0.1")
12+
613

714
defaultConfig {
8-
minSdkVersion 16
9-
targetSdkVersion 23
15+
minSdkVersion safeExtGet("minSdkVersion", 16)
16+
targetSdkVersion safeExtGet("targetSdkVersion", 23)
1017
versionCode 1
1118
versionName "1.0"
1219
ndk {

0 commit comments

Comments
 (0)