@@ -9,24 +9,19 @@ buildscript {
9
9
10
10
apply plugin : ' com.android.library'
11
11
12
- def _ext = rootProject. ext
12
+ def safeExtGet (prop , fallback ) {
13
+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
14
+ }
13
15
14
- def _reactNativeVersion = _ext. has(' reactNative' ) ? _ext. reactNative : ' +'
15
- def _compileSdkVersion = _ext. has(' compileSdkVersion' ) ? _ext. compileSdkVersion : 23
16
- def _buildToolsVersion = _ext. has(' buildToolsVersion' ) ? _ext. buildToolsVersion : ' 23.0.1'
17
- def _minSdkVersion = _ext. has(' minSdkVersion' ) ? _ext. minSdkVersion : 16
18
- def _targetSdkVersion = _ext. has(' targetSdkVersion' ) ? _ext. targetSdkVersion : 22
19
- def _glideVersion = _ext. has(' glideVersion' ) ? _ext. glideVersion : ' 4.7.1'
20
- def _excludeAppGlideModule = _ext. has(' excludeAppGlideModule' ) ? _ext. excludeAppGlideModule : false
21
16
22
17
android {
23
- compileSdkVersion _compileSdkVersion
24
- buildToolsVersion _buildToolsVersion
18
+ compileSdkVersion safeExtGet( ' compileSdkVersion ' , 26 )
19
+ buildToolsVersion safeExtGet( ' buildToolsVersion ' , ' 26.0.3 ' )
25
20
26
21
sourceSets {
27
22
main {
28
23
java {
29
- if (_excludeAppGlideModule ) {
24
+ if (safeExtGet( ' excludeAppGlideModule ' , false ) ) {
30
25
srcDir ' src'
31
26
exclude ' **/FastImageGlideModule.java'
32
27
}
@@ -35,8 +30,8 @@ android {
35
30
}
36
31
37
32
defaultConfig {
38
- minSdkVersion _minSdkVersion
39
- targetSdkVersion _targetSdkVersion
33
+ minSdkVersion safeExtGet( ' minSdkVersion ' , 16 )
34
+ targetSdkVersion safeExtGet( ' targetSdkVersion ' , 26 )
40
35
versionCode 1
41
36
versionName " 1.0"
42
37
}
@@ -54,16 +49,16 @@ repositories {
54
49
55
50
dependencies {
56
51
// noinspection GradleDynamicVersion
57
- compile " com.facebook.react:react-native:${ _reactNativeVersion } "
58
- compile " com.android.support:support-v4:${ _compileSdkVersion } "
59
- compile(" com.github.bumptech.glide:glide:${ _glideVersion } " ) {
52
+ compile " com.facebook.react:react-native:${ safeExtGet('reactNativeVersion', '+') } "
53
+ compile " com.android.support:support-v4:${ safeExtGet('compileSdkVersion', 26) } "
54
+ compile(" com.github.bumptech.glide:glide:${ safeExtGet('glideVersion', 4.7.1) } " ) {
60
55
exclude group : " com.android.support"
61
56
}
62
- compile(" com.github.bumptech.glide:annotations:${ _glideVersion } " ) {
57
+ compile(" com.github.bumptech.glide:annotations:${ safeExtGet('glideVersion', 4.7.1) } " ) {
63
58
exclude group : " com.android.support"
64
59
}
65
- annotationProcessor " com.github.bumptech.glide:compiler:${ _glideVersion } "
66
- compile(" com.github.bumptech.glide:okhttp3-integration:${ _glideVersion } " ) {
60
+ annotationProcessor " com.github.bumptech.glide:compiler:${ safeExtGet('glideVersion', 4.7.1) } "
61
+ compile(" com.github.bumptech.glide:okhttp3-integration:${ safeExtGet('glideVersion', 4.7.1) } " ) {
67
62
exclude group : " com.android.support"
68
63
exclude group : ' glide-parent'
69
64
}
0 commit comments