@@ -13,6 +13,15 @@ def isNewArchitectureEnabled() {
13
13
return project. hasProperty(" newArchEnabled" ) && project. newArchEnabled == " true"
14
14
}
15
15
16
+
17
+ def getKotlinVersion () {
18
+ return rootProject. ext. has(' kotlinVersion' ) ? rootProject. ext. get(' kotlinVersion' ) : ' 1.6.21'
19
+ }
20
+
21
+ def getCoroutinesVersion (kotlinVersion ) {
22
+ return kotlinVersion >= ' 1.9' ? ' 1.8.0' : ' 1.6.4'
23
+ }
24
+
16
25
// expo plugin
17
26
if (rootProject. ext. has(' expoRNMapboxMapsImpl' )) {
18
27
rootProject. ext. set(' RNMapboxMapsImpl' , rootProject. ext. get(' expoRNMapboxMapsImpl' ))
@@ -21,15 +30,17 @@ if (rootProject.ext.has('expoRNMapboxMapsVersion')) {
21
30
rootProject. ext. set(' RNMapboxMapsVersion' , rootProject. ext. get(' expoRNMapboxMapsVersion' ))
22
31
}
23
32
33
+ project. ext. set(" kotlinVersion" , getKotlinVersion())
24
34
25
35
buildscript {
26
36
repositories {
27
37
google()
28
38
mavenCentral()
29
39
}
30
40
41
+ def kotlinVersion = this . kotlinVersion
31
42
dependencies {
32
- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:${ rootProject.ext.has(' kotlinVersion') ? rootProject.ext.get('kotlinVersion') : '1.6.21' } "
43
+ classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:${ kotlinVersion} "
33
44
}
34
45
}
35
46
@@ -142,9 +153,8 @@ dependencies {
142
153
// React Native
143
154
implementation " com.facebook.react:react-native:+"
144
155
145
- // kotlin coroutines
146
- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:${ safeExtGet('kotlinxCoroutinesCoreVersion', '1.8.0')} "
147
- implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:${ safeExtGet('kotlinxCoroutinesAndroidVersion', '1.8.0')} "
156
+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-core:${ safeExtGet('kotlinxCoroutinesCoreVersion', getCoroutinesVersion(getKotlinVersion()))} "
157
+ implementation " org.jetbrains.kotlinx:kotlinx-coroutines-android:${ safeExtGet('kotlinxCoroutinesAndroidVersion', getCoroutinesVersion(getKotlinVersion()))} "
148
158
149
159
// Mapbox SDK
150
160
customizableDependencies(' RNMapboxMapsLibs' ) {
0 commit comments