1
1
apply plugin : ' com.android.library'
2
2
apply from : ' gradle-maven-push.gradle'
3
3
4
- def DEFAULT_COMPILE_SDK_VERSION = 25
5
- def DEFAULT_BUILD_TOOLS_VERSION = " 25.0.3"
6
- def DEFAULT_TARGET_SDK_VERSION = 25
7
- def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = " 10.2.4"
8
- def DEFAULT_ANDROID_MAPS_UTILS_VERSION = " 0.5+"
4
+ def safeExtGet (prop , fallback ) {
5
+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
6
+ }
9
7
10
8
android {
11
- compileSdkVersion rootProject . hasProperty (' compileSdkVersion' ) ? rootProject . compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
12
- buildToolsVersion rootProject . hasProperty (' buildToolsVersion' ) ? rootProject . buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
9
+ compileSdkVersion safeExtGet (' compileSdkVersion' , 27 )
10
+ buildToolsVersion safeExtGet (' buildToolsVersion' , ' 27.0.3 ' )
13
11
14
12
defaultConfig {
15
- minSdkVersion 16
16
- targetSdkVersion rootProject . hasProperty (' targetSdkVersion' ) ? rootProject . targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
13
+ minSdkVersion safeExtGet( ' minSdkVersion ' , 16 )
14
+ targetSdkVersion safeExtGet (' targetSdkVersion' , 27 )
17
15
}
18
16
19
17
packagingOptions {
@@ -40,10 +38,10 @@ android {
40
38
}
41
39
42
40
dependencies {
43
- def googlePlayServicesVersion = rootProject . hasProperty (' googlePlayServicesVersion' ) ? rootProject . googlePlayServicesVersion : DEFAULT_GOOGLE_PLAY_SERVICES_VERSION
44
- def androidMapsUtilsVersion = rootProject . hasProperty( ' androidMapsUtilsVersion ' ) ? rootProject . androidMapsUtilsVersion : DEFAULT_ANDROID_MAPS_UTILS_VERSION
41
+ def googlePlayServicesVersion = safeExtGet (' googlePlayServicesVersion' , ' 10.2.4 ' )
42
+ def androidMapsUtilsVersion = safeExtGet( ' googlePlayServicesVersion ' , ' 0.5+ ' )
45
43
46
- compileOnly " com.facebook.react:react-native:+ "
44
+ compileOnly " com.facebook.react:react-native:${ safeExtGet('reactNativeVersion', '+') } "
47
45
implementation " com.google.android.gms:play-services-base:$googlePlayServicesVersion "
48
46
implementation " com.google.android.gms:play-services-maps:$googlePlayServicesVersion "
49
47
implementation " com.google.maps.android:android-maps-utils:$androidMapsUtilsVersion "
0 commit comments