Skip to content

Commit 271a040

Browse files
author
Krzysztof Borowy
authored
feat(android): Bump Next version dependencies, min and target SDK (#949)
* bump kotlin, coroutines, room * update docs
1 parent 02477f1 commit 271a040

File tree

4 files changed

+16
-40
lines changed

4 files changed

+16
-40
lines changed

android/build.gradle

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,14 @@ buildscript {
3939
? rootProject.ext['kotlinVersion']
4040
: rootProject.hasProperty('AsyncStorage_kotlinVersion')
4141
? rootProject.properties['AsyncStorage_kotlinVersion']
42-
: '1.6.10'
42+
: '1.8.10'
4343

4444
repositories {
4545
mavenCentral()
4646
google()
4747
}
4848
dependencies {
49-
def projectExampleDir = Paths.get(project.projectDir.getParent(), "example", "android").toString()
50-
def rootProjectDir = rootProject.projectDir.getPath()
51-
if (projectExampleDir == rootProjectDir) {
52-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$asyncStorageKtVersion"
53-
}
49+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$asyncStorageKtVersion"
5450
}
5551
}
5652

@@ -78,10 +74,10 @@ if (useNextStorage) {
7874
}
7975

8076
android {
81-
compileSdkVersion safeExtGet('compileSdkVersion', 31)
77+
compileSdkVersion safeExtGet('compileSdkVersion', 32)
8278
defaultConfig {
83-
minSdkVersion safeExtGet('minSdkVersion', 21)
84-
targetSdkVersion safeExtGet('targetSdkVersion', 31)
79+
minSdkVersion safeExtGet('minSdkVersion', 23)
80+
targetSdkVersion safeExtGet('targetSdkVersion', 32)
8581
buildConfigField "Long", "AsyncStorage_db_size", "${dbSizeInMB}L"
8682
buildConfigField "boolean", "AsyncStorage_useDedicatedExecutor", "${useDedicatedExecutor}"
8783
buildConfigField "boolean", "AsyncStorage_useNextStorage", "${useNextStorage}"
@@ -112,9 +108,9 @@ repositories {
112108
dependencies {
113109

114110
if (useNextStorage) {
115-
def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.2')
116-
def coroutines_version = "1.6.0"
117-
def coroutinesTest_version = "1.6.0"
111+
def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3')
112+
def coroutines_version = "1.6.4"
113+
def coroutinesTest_version = "1.6.4"
118114
// if we don't provide explicit dependency on reflection, kotlin plugin
119115
// would add one automatically, probably a version that is not compatible with
120116
// used kotlin

android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ private object MIGRATION_TO_NEXT : Migration(1, 2) {
105105
}
106106
}
107107

108-
@Database(entities = [Entry::class], version = DATABASE_VERSION, exportSchema = true)
108+
@Database(entities = [Entry::class], version = DATABASE_VERSION, exportSchema = false)
109109
internal abstract class StorageDb : RoomDatabase() {
110110
abstract fun storage(): StorageDao
111111

example/android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ android.enableJetifier=true
4242
#ANDROID_NDK_VERSION=21.4.7075529
4343

4444
# Version of Kotlin to build against.
45-
KOTLIN_VERSION=1.6.21
45+
KOTLIN_VERSION=1.8.10
4646

4747
# This is an example of how you can change default DB size (6MB) to 10MB
4848
#AsyncStorage_db_size_in_MB=10

website/docs/advanced/Next.md

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,7 @@ When you enable the feature again, the new database is **not** recreated, becaus
3838

3939
### Enable
4040

41-
See [Configuration](#configuration) section below to learn more about setting different versions of Kotlin or Room.
42-
43-
1. In your project's `android` directory, locate root `build.gradle` file. Add Kotlin dependency to the `buildscript`:
44-
45-
```diff
46-
buildscript {
47-
ext {
48-
// other extensions
49-
+ kotlinVersion = '1.6.10'
50-
}
51-
52-
dependencies {
53-
// other dependencies
54-
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
55-
}
56-
}
57-
58-
```
59-
60-
2. In the same directory (normally `android`) locate `gradle.properties` file (if it does not exist, create one) and add the line:
61-
41+
In your project's `android` directory, locate `gradle.properties` file (if it does not exist, create one) and add the line:
6242
```groovy
6343
AsyncStorage_useNextStorage=true
6444
```
@@ -67,28 +47,28 @@ AsyncStorage_useNextStorage=true
6747

6848
**Kotlin version**
6949

70-
Next storage is tested against Kotlin version `1.6.10`.
50+
Next storage is tested against Kotlin version `1.8.10`.
7151
You can specify different version, in one of two ways:
7252

7353
- add `kotlinVersion` extension to the `rootProject`:
7454

7555
```groovy
76-
rootProject.ext.kotlinVersion = '1.6.10'
56+
rootProject.ext.kotlinVersion = '1.8.10'
7757
```
7858

7959
- specify `AsyncStorage_kotlinVersion` in `gradle.properties`:
8060

8161
```groovy
82-
AsyncStorage_kotlinVersion=1.6.10
62+
AsyncStorage_kotlinVersion=1.8.10
8363
```
8464

8565
**Room**
8666

8767
Next AsyncStorage uses [Room persistence library](https://developer.android.com/jetpack/androidx/releases/room) to store data.
88-
Currently, tested version is `2.4.2`. You can specify different version, by adding a flag to `gradle.properties`:
68+
Currently, tested version is `2.4.3`. You can specify different version, by adding a flag to `gradle.properties`:
8969

9070
```groovy
91-
AsyncStorage_next_roomVersion=2.4.2
71+
AsyncStorage_next_roomVersion=2.4.3
9272
```
9373

9474
### Notable changes

0 commit comments

Comments
 (0)