File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 1
1
apply plugin : ' com.android.library'
2
2
3
- def _ext = rootProject. ext
4
-
5
- def _compileSdkVersion = _ext. has(' compileSdkVersion' ) ? _ext. compileSdkVersion : 27
6
- def _buildToolsVersion = _ext. has(' buildToolsVersion' ) ? _ext. buildToolsVersion : ' 27.0.3'
7
- def _minSdkVersion = _ext. has(' minSdkVersion' ) ? _ext. minSdkVersion : 16
8
- def _targetSdkVersion = _ext. has(' targetSdkVersion' ) ? _ext. targetSdkVersion : 27
3
+ def safeExtGet (prop , fallback ) {
4
+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
5
+ }
9
6
10
7
android {
11
- compileSdkVersion _compileSdkVersion
12
- buildToolsVersion _buildToolsVersion
8
+ compileSdkVersion safeExtGet( ' compileSdkVersion ' , 23 )
9
+ buildToolsVersion safeExtGet( ' buildToolsVersion ' , " 23.0.1 " )
13
10
14
11
defaultConfig {
15
- minSdkVersion _minSdkVersion
16
- targetSdkVersion _targetSdkVersion
12
+ minSdkVersion safeExtGet( ' minSdkVersion ' , 16 )
13
+ targetSdkVersion safeExtGet( ' targetSdkVersion ' , 22 )
17
14
versionCode 1
18
15
versionName " 1.0"
19
16
}
You can’t perform that action at this time.
0 commit comments