-
Notifications
You must be signed in to change notification settings - Fork 427
/
build.gradle
107 lines (92 loc) · 4.78 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
rootProject.allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://developer.huawei.com/repo/' }
}
}
apply plugin: 'com.android.library'
// Android dependencies
def DEFAULT_COMPILE_SDK_VERSION = 31
def DEFAULT_TARGET_SDK_VERSION = 30
def DEFAULT_APP_COMPAT_VERSION = "1.6.1"
// Plugin dependencies
def DEFAULT_PLAY_SERVICES_LOCATION_VERSION = "20.0.0"
def DEFAULT_HMS_LOCATION_VERSION = "6.9.0.300"
def DEFAULT_OK_HTTP_VERSION = "3.12.13"
def DEFAULT_ANDROID_PERMISSIONS_VERSION = "2.1.6"
def DEFAULT_EVENTBUS_VERSION = "3.3.1"
def DEFAULT_LOCAL_BROADCAST_MANAGER_VERSION = "1.0.0"
def DEFAULT_LIFE_CYCLE_RUNTIME_VERSION = "2.4.1"
def DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION = "2.2.0"
def DEFAULT_LOGBACK_VERSION = "2.0.1"
def DEFAULT_SLF4J_VERSION = "1.7.36"
def DEFAULT_WORK_VERSION = "2.8.1"
def DEFAULT_CONCURRENT_FUTURES_VERSION = "1.1.0"
def useAndroidX = (project.hasProperty("android.useAndroidX")) ? project.property("android.useAndroidX") : false
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
if (project.android.hasProperty("namespace")) {
namespace("com.transistorsoft.rnbackgroundgeolocation")
}
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
consumerProguardFiles 'proguard-rules.pro'
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories{
maven {
url './libs'
}
}
dependencies {
// Prefer appCompatVersion vs supportLibVersion.
def appCompatVersion = safeExtGet('appCompatVersion', DEFAULT_APP_COMPAT_VERSION)
def playServicesLocationVersion = safeExtGet('playServicesLocationVersion', safeExtGet('googlePlayServicesLocationVersion', DEFAULT_PLAY_SERVICES_LOCATION_VERSION))
def hmsLocationVersion = safeExtGet('hmsLocationVersion', DEFAULT_HMS_LOCATION_VERSION);
def okHttpVersion = safeExtGet('okHttpVersion', DEFAULT_OK_HTTP_VERSION)
def androidPermissionsVersion = safeExtGet('androidPermissionsVersion', DEFAULT_ANDROID_PERMISSIONS_VERSION)
def eventBusVersion = safeExtGet('eventBusVersion', DEFAULT_EVENTBUS_VERSION)
def localBroadcastManagerVersion = safeExtGet('localBroadcastManagerVersion', DEFAULT_LOCAL_BROADCAST_MANAGER_VERSION)
def lifeCycleRuntimeVersion = safeExtGet('lifeCycleRuntimeVersion', DEFAULT_LIFE_CYCLE_RUNTIME_VERSION)
def lifeCycleExtensionsVersion = safeExtGet('lifeCycleExtensionsVersion', DEFAULT_LIFE_CYCLE_EXTENSIONS_VERSION)
def logbackVersion = safeExtGet('logbackVersion', DEFAULT_LOGBACK_VERSION);
def slf4jVersion = safeExtGet('slf4jVersion', DEFAULT_SLF4J_VERSION);
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
def locationMajorVersion = playServicesLocationVersion.split('\\.')[0] as int
if (locationMajorVersion >= 21) {
api(group: 'com.transistorsoft', name:'tslocationmanager-v21', version: '+')
} else {
api(group: 'com.transistorsoft', name:'tslocationmanager', version: '+')
}
implementation "androidx.appcompat:appcompat:$appCompatVersion"
implementation "com.google.android.gms:play-services-location:$playServicesLocationVersion"
// HMS location
implementation("com.huawei.hms:location:$hmsLocationVersion") {
exclude(group: "com.huawei.hms", module: 'hianalytics')
}
implementation "org.greenrobot:eventbus:$eventBusVersion"
implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"
// logback-android
implementation "com.github.tony19:logback-android:$logbackVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
implementation "io.github.nishkarsh:android-permissions:$androidPermissionsVersion"
// LifeCycleObserver
implementation "androidx.lifecycle:lifecycle-runtime:$lifeCycleRuntimeVersion"
implementation "androidx.lifecycle:lifecycle-extensions:$lifeCycleExtensionsVersion"
// WorkManager
def workVersion = safeExtGet('workVersion', DEFAULT_WORK_VERSION)
def concurrentFuturesVersion = safeExtGet('concurrentFuturesVersion', DEFAULT_CONCURRENT_FUTURES_VERSION)
implementation "androidx.work:work-runtime:$workVersion"
implementation "androidx.concurrent:concurrent-futures:$concurrentFuturesVersion"
}