Skip to content

Commit 2be0191

Browse files
author
Krzysztof Borowy
committed
versions
1 parent 14f1791 commit 2be0191

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

packages/default-storage/android/build.gradle

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ buildscript {
1919

2020

2121
apply plugin: 'com.android.library'
22-
apply from: "config.gradle"
22+
apply from: 'config.gradle'
2323

2424
boolean isNewArchitectureEnabled = ext.AsyncStorageConfig.isNewArchitectureEnabled
2525
boolean useNextStorage = ext.AsyncStorageConfig.useNextStorage
2626

27-
println("[AsyncStorage] Config: ${ext.AsyncStorageConfig}")
28-
2927
if (useNextStorage) {
3028
apply plugin: 'com.google.devtools.ksp'
3129
apply plugin: 'kotlin-android'
@@ -103,26 +101,20 @@ repositories {
103101
dependencies {
104102
if (useNextStorage) {
105103
def room_version = project.ext.AsyncStorageConfig.roomVersion
106-
def coroutines_version = "1.7.3"
107-
def junit_version = "4.13.2"
108-
def robolectric_version = "4.11.1"
109-
def truth_version = "1.1.3"
110-
def androidxtest_version = "1.4.0"
111-
def androidtest_junit_version = "1.1.3"
112104

113105
implementation "androidx.room:room-runtime:$room_version"
114106
implementation "androidx.room:room-ktx:$room_version"
115107
ksp "androidx.room:room-compiler:$room_version"
116108

117-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version"
109+
implementation project.ext.AsyncStorageLibs.coroutines
118110

119-
testImplementation "junit:junit:$junit_version"
120-
testImplementation "androidx.test:runner:$androidxtest_version"
121-
testImplementation "androidx.test:rules:$androidxtest_version"
122-
testImplementation "androidx.test.ext:junit:$androidtest_junit_version"
123-
testImplementation "org.robolectric:robolectric:$robolectric_version"
124-
testImplementation "com.google.truth:truth:$truth_version"
125-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
111+
testImplementation project.ext.AsyncStorageLibs.testCoroutines
112+
testImplementation project.ext.AsyncStorageLibs.testJunit
113+
testImplementation project.ext.AsyncStorageLibs.testExtJunit
114+
testImplementation project.ext.AsyncStorageLibs.testRunner
115+
testImplementation project.ext.AsyncStorageLibs.testRules
116+
testImplementation project.ext.AsyncStorageLibs.testRobolectric
117+
testImplementation project.ext.AsyncStorageLibs.testTruth
126118
}
127119

128120
implementation 'com.facebook.react:react-native:+' // from node_modules

packages/default-storage/android/config.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ def DEFAULT_KOTLIN_VERSION = "1.9.20"
44
def DEFAULT_ROOM_VERSION = "2.4.3"
55

66
project.ext.AsyncStorageConfig = [
7-
kotlinVersion : getKotlinVersion(),
7+
kotlinVersion : getKotlinVersion(DEFAULT_KOTLIN_VERSION),
88
kspVersion : getKspVersion(kotlinVersion),
99
roomVersion : getPropertyOfDefault('AsyncStorage_next_roomVersion', DEFAULT_ROOM_VERSION),
1010
minSdkVersion : safeExtGet('minSdkVersion', 23),
@@ -16,13 +16,24 @@ project.ext.AsyncStorageConfig = [
1616
useDedicatedExecutor : getFlagOrDefault('AsyncStorage_dedicatedExecutor', false),
1717
]
1818

19+
project.ext.AsyncStorageLibs = [
20+
coroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3",
21+
testCoroutines : "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3",
22+
testJunit : "junit:junit:4.13.2",
23+
testRunner : "androidx.test:runner:1.4.0",
24+
testRules : "androidx.test:rules:1.4.0",
25+
testExtJunit : "androidx.test.ext:junit:1.1.3",
26+
testRobolectric: "org.robolectric:robolectric:4.11.1",
27+
testTruth : "com.google.truth:truth:1.1.3",
28+
]
29+
1930

20-
def getKotlinVersion() {
31+
def getKotlinVersion(String defaultVersion) {
2132
return rootProject.ext.has('kotlinVersion')
2233
? rootProject.ext['kotlinVersion']
2334
: rootProject.hasProperty('AsyncStorage_kotlinVersion')
2435
? rootProject.properties['AsyncStorage_kotlinVersion']
25-
: DEFAULT_KOTLIN_VERSION
36+
: defaultVersion
2637
}
2738

2839
def isNewArchitectureEnabled() {

0 commit comments

Comments
 (0)