Skip to content

Commit 3aaedad

Browse files
authored
Merge pull request #104 from qiaoyuang/main
Update version to 1.4.2
2 parents fd89091 + 6bac769 commit 3aaedad

File tree

13 files changed

+67
-45
lines changed

13 files changed

+67
-45
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@v4
2727

2828
- name: Validate Gradle Wrapper
29-
uses: gradle/wrapper-validation-action@v3
29+
uses: gradle/actions/wrapper-validation@v3
3030

3131
- name: Set up JDK 21
3232
uses: actions/setup-java@v4
@@ -80,7 +80,7 @@ jobs:
8080
target: google_apis
8181
arch: x86_64
8282
profile: pixel_6
83-
emulator-build: 12694320
83+
emulator-build: 13373845
8484
force-avd-creation: false
8585
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
8686
disable-animations: true
@@ -93,7 +93,7 @@ jobs:
9393
target: google_apis
9494
arch: x86_64
9595
profile: pixel_6
96-
emulator-build: 12694320
96+
emulator-build: 13373845
9797
force-avd-creation: false
9898
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
9999
disable-animations: true
@@ -122,7 +122,7 @@ jobs:
122122
uses: actions/checkout@v4
123123

124124
- name: Validate Gradle Wrapper
125-
uses: gradle/wrapper-validation-action@v3
125+
uses: gradle/actions/wrapper-validation@v3
126126

127127
- name: Set up JDK 21
128128
uses: actions/setup-java@v4
@@ -182,7 +182,7 @@ jobs:
182182
uses: actions/checkout@v4
183183

184184
- name: Validate Gradle Wrapper
185-
uses: gradle/wrapper-validation-action@v3
185+
uses: gradle/actions/wrapper-validation@v3
186186

187187
- name: Set up JDK 21
188188
uses: actions/setup-java@v4
@@ -239,7 +239,7 @@ jobs:
239239
target: default
240240
arch: x86_64
241241
profile: pixel_2
242-
emulator-build: 12694320
242+
emulator-build: 13373845
243243
force-avd-creation: false
244244
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
245245
disable-animations: true
@@ -252,7 +252,7 @@ jobs:
252252
target: default
253253
arch: x86_64
254254
profile: pixel_2
255-
emulator-build: 12694320
255+
emulator-build: 13373845
256256
force-avd-creation: false
257257
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
258258
disable-animations: true

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v4
2222

2323
- name: Validate Gradle Wrapper
24-
uses: gradle/wrapper-validation-action@v3
24+
uses: gradle/actions/wrapper-validation@v3
2525

2626
- name: Set up JDK 21
2727
uses: actions/setup-java@v4
@@ -58,7 +58,7 @@ jobs:
5858
uses: actions/checkout@v4
5959

6060
- name: Validate Gradle Wrapper
61-
uses: gradle/wrapper-validation-action@v3
61+
uses: gradle/actions/wrapper-validation@v3
6262

6363
- name: Set up JDK 21
6464
uses: actions/setup-java@v4
@@ -95,7 +95,7 @@ jobs:
9595
uses: actions/checkout@v4
9696

9797
- name: Validate Gradle Wrapper
98-
uses: gradle/wrapper-validation-action@v3
98+
uses: gradle/actions/wrapper-validation@v3
9999

100100
- name: Set up JDK 21
101101
uses: actions/setup-java@v4

CHANGELOG.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
# SQLlin Change Log
22

33
- Date format: YYYY-MM-dd
4-
-
5-
## v1.4.2 / 2025-xx-xx
4+
5+
## v1.4.2 / 2025-04-23
6+
7+
### All
8+
9+
* Update `Kotlin`'s version to `2.1.20`
10+
11+
### sqllin-dsl
12+
13+
* Update `kotlinx.coroutines`'s version to `1.10.2`
14+
* Update `kotlinx.serialization`'s version to `1.8.1`
615

716
### sqllin-driver
817

9-
* Update the `sqlite-jdbc`'s version to `3.49.0.0`
18+
* Update the `sqlite-jdbc`'s version to `3.49.1.0`
19+
20+
### sqllin-processor
21+
22+
* Update `KSP`'s version to `2.1.20-1.0.32`
1023

1124
## v1.4.1 / 2025-02-04
1225

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.4.1
1+
VERSION=1.4.2
22
GROUP=com.ctrip.kotlin
33

44
#Maven Publish Information
@@ -27,5 +27,5 @@ kotlin.code.style=official
2727
kotlin.mpp.stability.nowarn=true
2828
kotlin.mpp.enableCInteropCommonization=true
2929
kotlin.natvie.increment=true
30-
#ksp.useKSP2=true
30+
kotlin.jvm.target.validation.mode=warning
3131
#kotlin.compiler.execution.strategy=out-of-process

gradle/libs.versions.toml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[versions]
22

3-
kotlin = "2.1.10"
4-
agp = "8.7.3"
5-
ksp = "2.1.10-1.0.29"
6-
serialization = "1.8.0"
7-
coroutines = "1.10.1"
3+
kotlin = "2.1.20"
4+
agp = "8.9.2"
5+
ksp = "2.1.20-1.0.32"
6+
serialization = "1.8.1"
7+
coroutines = "1.10.2"
88
androidx-annotation = "1.9.1"
99
androidx-test = "1.6.1"
1010
androidx-test-runner = "1.6.2"
11-
sqlite-jdbc = "3.49.0.0"
11+
sqlite-jdbc = "3.49.1.0"
12+
desugar-jdk-libs = "2.1.5"
1213

1314
[libraries]
1415

@@ -24,6 +25,8 @@ androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "
2425

2526
sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }
2627

28+
desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "desugar-jdk-libs" }
29+
2730
[plugins]
2831

2932
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Tue Mar 08 15:11:46 CST 2022
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

sample/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ plugins {
1111
version = "1.0"
1212

1313
kotlin {
14+
jvmToolchain(21)
1415
androidTarget {
1516
publishLibraryVariants("release")
1617
}
@@ -47,12 +48,12 @@ android {
4748
minSdk = 23
4849
}
4950
compileOptions {
50-
sourceCompatibility = JavaVersion.VERSION_11
51-
targetCompatibility = JavaVersion.VERSION_21
51+
isCoreLibraryDesugaringEnabled = true
5252
}
5353
}
5454

5555
dependencies {
56+
coreLibraryDesugaring(libs.desugar.jdk.libs)
5657
add("kspCommonMainMetadata", project(":sqllin-processor"))
5758
}
5859

sqllin-driver/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ version = VERSION
2020
@OptIn(ExperimentalKotlinGradlePluginApi::class)
2121
kotlin {
2222
explicitApi()
23+
jvmToolchain(21)
2324
androidTarget {
2425
publishLibraryVariants("release")
2526
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
@@ -106,8 +107,7 @@ android {
106107
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
107108
}
108109
compileOptions {
109-
sourceCompatibility = JavaVersion.VERSION_11
110-
targetCompatibility = JavaVersion.VERSION_21
110+
isCoreLibraryDesugaringEnabled = true
111111
}
112112
}
113113

@@ -125,6 +125,10 @@ fun KotlinNativeTarget.setupNativeConfig() {
125125
}
126126
}
127127

128+
dependencies {
129+
coreLibraryDesugaring(libs.desugar.jdk.libs)
130+
}
131+
128132
val javadocJar: TaskProvider<Jar> by tasks.registering(Jar::class) {
129133
archiveClassifier.set("javadoc")
130134
}

sqllin-dsl/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ version = VERSION
2323
@OptIn(ExperimentalKotlinGradlePluginApi::class)
2424
kotlin {
2525
explicitApi()
26+
jvmToolchain(21)
2627
androidTarget {
2728
publishLibraryVariants("release")
2829
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
@@ -171,8 +172,7 @@ android {
171172
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
172173
}
173174
compileOptions {
174-
sourceCompatibility = JavaVersion.VERSION_11
175-
targetCompatibility = JavaVersion.VERSION_21
175+
isCoreLibraryDesugaringEnabled = true
176176
}
177177
}
178178

@@ -189,6 +189,7 @@ fun KotlinNativeTarget.setupNativeConfig() {
189189
}
190190

191191
dependencies {
192+
coreLibraryDesugaring(libs.desugar.jdk.libs)
192193
val sourceSets = listOf(
193194
"kspAndroidAndroidTest",
194195

sqllin-dsl/doc/concurrency-safety-cn.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# 并发安全
22

33
`1.2.2` 版本之前, _sqllin-dsl_ 无法保证并发安全。如果你想在不同的线程中共享同一个 `Database`
4-
对象,这可能会导致不可预测的结果。所以最佳的方式是:当你想要操作你的数据库时,创建一个 `Database`
5-
对象,当你结束的你的操作时,立即关闭它
4+
实例,这可能会导致不可预测的结果。所以最佳的方式是:当你想要操作数据库时,创建一个 `Database`
5+
实例,而当你结束操作时立即关闭它
66

7-
但是这非常不方便,我们总是必须频繁地创建数据库连接并关闭它,这是一种对资源的浪费。举例来说,
7+
但是这非常不方便,我们总是必须频繁地创建数据库连接并关闭,是一种对资源的浪费。举例来说,
88
如果我们正在开发一款 Android app,并且在单个页面中(Activity/Fragment),我们希望我们可以持有一个
9-
`Database` 对象,当我们想要在后台线程(或协程)中操作数据库时,直接使用它,并在某些生命周期函数内关闭它
9+
`Database` 实例,当我们想要在后台线程(或协程)中操作数据库时直接使用它,并在某些生命周期函数内将它关闭
1010
`onDestroy``onStop` 等等)。
1111

12-
这种情况下,当我们在不同线程(或协程)中共享 `Database` 对象时,我们应该确保并发安全。所以,从 `1.2.2`
12+
这种情况下,当我们在不同线程(或协程)中共享 `Database` 实例时,我们应该确保并发安全。所以,从 `1.2.2`
1313
版本开始,我们可以使用新 API `Database#suspendedScope` 来代替旧的 `database {}` 用法。比如说,如果我们有如下旧代码:
1414

1515
```kotlin
@@ -26,7 +26,7 @@ fun sample() {
2626
}
2727
}
2828
```
29-
我们使用新 API `Database#suspendedScope` 来代替旧的 `database {}` 后,将会是这样:
29+
我们使用新 API `Database#suspendedScope` 来代替旧 `database {}` 后,将会是这样:
3030

3131
```kotlin
3232
fun sample() {
@@ -42,8 +42,8 @@ fun sample() {
4242
}
4343
}
4444
```
45-
`suspendedScope` 是一个挂起函数。在 `suspendedScope` 内部,所有的操作都是原子性的。这意味着:如果你共享了同一个
46-
`Database` 对象到不同的协程中,它可以保证后执行的 `suspendedScope` 会等待先执行的 `suspendedScope` 执行完成。
45+
`suspendedScope` 是一个挂起函数。在 `suspendedScope` 内部所有的操作都是原子性的。这意味着:如果你共享了同一个
46+
`Database` 实例到不同的协程中,它可以保证后执行的 `suspendedScope` 会等待先执行的 `suspendedScope` 执行完成。
4747

4848
## 接下来
4949

sqllin-dsl/doc/concurrency-safety.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Concurrency Safety
22

33
Before the version `1.2.2`, _sqllin-dsl_ can't ensure the concurrency safety. If
4-
you want to share a `Database` object between different threads, that would lead to
4+
you want to share a `Database` instance between different threads, that would lead to
55
unpredictable consequences. So, the best way is when you want to operate your
6-
database, create a `Database` object, and when you finish your operating, close it immediately.
6+
database, create a `Database` instance, and when you finish your operating, close it immediately.
77

88
But, that's very inconvenient, we always have to create a database connection and
99
close it frequently, this is a waste of resources. For example, if we are developing
1010
an Android app, and in a single page (Activity/Fragment), we hope we can keep a
11-
`Database` object, when we want to operate the database in background threads (or
11+
`Database` instance, when we want to operate the database in background threads (or
1212
coroutines), just use it, and, close it in certain lifecycle
1313
functions (`onDestroy`, `onStop`, etc.).
1414

1515
At that time, we should make sure the concurrency safety that we share the `Database`
16-
object between different threads (or coroutines). So, start with the version `1.2.2`, we can
16+
instance between different threads (or coroutines). So, start with the version `1.2.2`, we can
1717
use the new API `Database#suspendedScope` to replace the usage of `database {}`. For
1818
example, if we have some old code:
1919

@@ -49,7 +49,7 @@ fun sample() {
4949
```
5050

5151
The `suspendedScope` is a suspend function. Inside the `suspendedScope`, the all operations are
52-
atomic. That means: If you share the same `Database` object between two coroutines, it can ensure the
52+
atomic. That means: If you share the same `Database` instance between two coroutines, it can ensure the
5353
`suspendedScope` executing later will wait for the one executing earlier to finish.
5454

5555
## Next Step

sqllin-dsl/doc/getting-start-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
id("com.google.devtools.ksp")
1515
}
1616

17-
val sqllinVersion = "1.4.1"
17+
val sqllinVersion = "1.4.2"
1818

1919
kotlin {
2020
// ......

sqllin-dsl/doc/getting-start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ plugins {
1616
id("com.google.devtools.ksp")
1717
}
1818

19-
val sqllinVersion = "1.4.1"
19+
val sqllinVersion = "1.4.2"
2020

2121
kotlin {
2222
// ......
@@ -30,10 +30,10 @@ kotlin {
3030
implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion")
3131

3232
// The sqllin-dsl serialization and deserialization depends on kotlinx-serialization
33-
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.8.0")
33+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.8.1")
3434

3535
// Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines
36-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
36+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
3737
}
3838
}
3939
// ......

0 commit comments

Comments
 (0)