Skip to content

Commit a82f933

Browse files
committed
read project vars for compileSdkVersion, buildToolsVersion,
`targetSdkVersion`
1 parent 8d2bc78 commit a82f933

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

android/build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ buildscript {
1111

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

14+
def projectVar(name, fallback) {
15+
return project.findProperty(name) ?: fallback
16+
}
17+
1418
android {
15-
compileSdkVersion 23
16-
buildToolsVersion "23.0.1"
19+
compileSdkVersion projectVar('compileSdkVersion', 23)
20+
buildToolsVersion projectVar('buildToolsVersion', '23.0.1')
1721

1822
defaultConfig {
1923
minSdkVersion 16
20-
targetSdkVersion 22
24+
targetSdkVersion projectVar('targetSdkVersion', 22)
2125
versionCode 1
2226
versionName "1.0"
2327
}

0 commit comments

Comments
 (0)