Skip to content

Commit 112c7aa

Browse files
author
zhouey
committed
android sdk 版本可根据主项目适应, 高德定位sdk版本也可自定义
1 parent caa6fcb commit 112c7aa

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

android/build.gradle

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ buildscript {
1111
}
1212
}
1313

14+
def safeExtGet(prop, fallback) {
15+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
16+
}
17+
1418
android {
15-
compileSdkVersion 28
16-
buildToolsVersion "28.0.3"
19+
compileSdkVersion safeExtGet('compileSdkVersion', 28)
20+
buildToolsVersion safeExtGet('buildToolsVersion', "28.0.3")
1721

1822
defaultConfig {
19-
minSdkVersion 16
20-
targetSdkVersion 28
23+
minSdkVersion safeExtGet('minSdkVersion', 16)
24+
targetSdkVersion safeExtGet('targetSdkVersion', 28)
2125
versionCode 1
2226
versionName "1.0"
2327
}
@@ -34,6 +38,5 @@ repositories {
3438

3539
dependencies {
3640
implementation 'com.facebook.react:react-native:+'
37-
implementation 'com.amap.api:location:4.5.1'
41+
implementation "com.amap.api:location:${safeExtGet('amapLocationSDK', '4.5.1')}"
3842
}
39-

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-amap-location-api",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"description": "AMap location SDK for react native",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)