@@ -15,20 +15,17 @@ allprojects {
15
15
16
16
apply plugin : ' com.android.library'
17
17
18
- def DEFAULT_COMPILE_SDK_VERSION = 27
19
- def DEFAULT_BUILD_TOOLS_VERSION = " 27.0.3"
20
- def DEFAULT_TARGET_SDK_VERSION = 27
21
- def DEFAULT_SUPPORT_LIB_VERSION = " 27.1.1"
22
- def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = " +"
23
- def DEFAULT_FIREBASE_MESSAGING_VERSION = " +"
18
+ def safeExtGet (prop , fallback ) {
19
+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
20
+ }
24
21
25
22
android {
26
- compileSdkVersion project . hasProperty (' compileSdkVersion' ) ? project . compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
27
- buildToolsVersion project . hasProperty (' buildToolsVersion' ) ? project . buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
23
+ compileSdkVersion safeExtGet (' compileSdkVersion' , 28 )
24
+ buildToolsVersion safeExtGet (' buildToolsVersion' , ' 28.0.3 ' )
28
25
29
26
defaultConfig {
30
- minSdkVersion 16
31
- targetSdkVersion project . hasProperty (' targetSdkVersion' ) ? project . targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
27
+ minSdkVersion safeExtGet( ' minSdkVersion ' , 16 )
28
+ targetSdkVersion safeExtGet (' targetSdkVersion' , 28 )
32
29
versionCode 1
33
30
versionName " 1.0"
34
31
ndk {
@@ -44,15 +41,11 @@ android {
44
41
}
45
42
46
43
dependencies {
47
- def supportLibVersion = project. hasProperty(' supportLibVersion' ) ? project. supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION
48
- def googlePlayServicesVersion = project. hasProperty(' googlePlayServicesVersion' ) ? project. googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
49
- def firebaseVersion = project. hasProperty(' firebaseVersion' ) ? project. firebaseVersion : DEFAULT_FIREBASE_MESSAGING_VERSION
50
-
51
- compile fileTree(dir : ' libs' , include : [' *.jar' ])
52
- testCompile ' junit:junit:4.12'
53
- compile " com.android.support:appcompat-v7:$supportLibVersion "
54
- compile ' com.facebook.react:react-native:+'
55
- compile " com.google.android.gms:play-services-gcm:$googlePlayServicesVersion "
56
- compile ' me.leolin:ShortcutBadger:1.1.8@aar'
57
- compile " com.google.firebase:firebase-messaging:$firebaseVersion "
44
+ implementation fileTree(dir : ' libs' , include : [' *.jar' ])
45
+ testImplementation ' junit:junit:4.12'
46
+ implementation " com.android.support:appcompat-v7:${ safeExtGet('supportLibVersion', '28.0.0')} "
47
+ implementation " com.facebook.react:react-native:${ safeExtGet('reactNativeVersion', '+')} "
48
+ implementation " com.google.android.gms:play-services-gcm:${ safeExtGet('googlePlayServicesVersion', '+')} "
49
+ implementation ' me.leolin:ShortcutBadger:1.1.8@aar'
50
+ implementation " com.google.firebase:firebase-messaging:${ safeExtGet('firebaseVersion', '+')} "
58
51
}
0 commit comments