Skip to content

Commit 028c624

Browse files
authored
Merge pull request #107 from qiaoyuang/main
Libraries Update
2 parents e8a6dee + b1d02a8 commit 028c624

File tree

10 files changed

+52
-52
lines changed

10 files changed

+52
-52
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build & Test & Publish
1+
name: Build & Publish
22

33
on:
44
workflow_dispatch:

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
- Date format: YYYY-MM-dd
44

5+
## 2.0.0 / 2025-10-xx
6+
7+
### All
8+
9+
* Update `Kotlin`'s version to `2.2.20`
10+
* Remove the Desuger configuration
11+
12+
### sqllin-driver
13+
14+
* Update the `sqlite-jdbc`'s version to `3.50.3.0`
15+
16+
### sqllin-processor
17+
18+
* Update `KSP`'s version to `2.2.20-2.0.4`
19+
520
## 1.4.4 / 2025-07-07
621

722
### All

gradle/libs.versions.toml

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

3-
kotlin = "2.2.0"
4-
agp = "8.10.1"
5-
ksp = "2.2.0-2.0.2"
3+
kotlin = "2.2.20"
4+
agp = "8.12.3"
5+
ksp = "2.2.20-2.0.4"
66
serialization = "1.9.0"
77
coroutines = "1.10.2"
88
androidx-annotation = "1.9.1"
9-
androidx-test = "1.6.1"
10-
androidx-test-runner = "1.6.2"
11-
sqlite-jdbc = "3.50.2.0"
12-
desugar-jdk-libs = "2.1.5"
9+
androidx-test = "1.7.0"
10+
androidx-test-runner = "1.7.0"
11+
sqlite-jdbc = "3.50.3.0"
1312
jvm-toolchain = "21"
1413
android-sdk-compile = "36"
1514
android-sdk-min = "23"
16-
vanniktech-maven-publish = "0.33.0"
15+
vanniktech-maven-publish = "0.34.0"
1716

1817
[libraries]
1918

2019
ksp = { group = "com.google.devtools.ksp", name= "symbol-processing-api", version.ref = "ksp" }
2120

2221
kotlinx-serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "serialization" }
23-
kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
22+
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "coroutines" }
23+
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutines" }
2424

2525
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" }
2626
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidx-test" }
@@ -29,8 +29,6 @@ androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "
2929

3030
sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }
3131

32-
desugar-jdk-libs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "desugar-jdk-libs" }
33-
3432
[plugins]
3533

3634
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

sample/build.gradle.kts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ kotlin {
3535
dependencies {
3636
implementation(project(":sqllin-dsl"))
3737
implementation(libs.kotlinx.serialization)
38-
implementation(libs.kotlinx.coroutines)
38+
implementation(libs.kotlinx.coroutines.core)
3939
}
4040
}
4141
}
@@ -47,13 +47,9 @@ android {
4747
defaultConfig {
4848
minSdk = libs.versions.android.sdk.min.get().toInt()
4949
}
50-
compileOptions {
51-
isCoreLibraryDesugaringEnabled = true
52-
}
5350
}
5451

5552
dependencies {
56-
coreLibraryDesugaring(libs.desugar.jdk.libs)
5753
add("kspCommonMainMetadata", project(":sqllin-processor"))
5854
}
5955

sqllin-driver/build.gradle.kts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ kotlin {
6767
}
6868
commonTest.dependencies {
6969
implementation(kotlin("test"))
70-
implementation(libs.kotlinx.coroutines)
70+
implementation(libs.kotlinx.coroutines.core)
71+
implementation(libs.kotlinx.coroutines.test)
7172
}
7273
androidMain.dependencies {
7374
implementation(libs.androidx.annotation)
@@ -105,9 +106,6 @@ android {
105106
minSdk = libs.versions.android.sdk.min.get().toInt()
106107
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
107108
}
108-
compileOptions {
109-
isCoreLibraryDesugaringEnabled = true
110-
}
111109
}
112110

113111
fun KotlinNativeTarget.setupNativeConfig() {
@@ -124,10 +122,6 @@ fun KotlinNativeTarget.setupNativeConfig() {
124122
}
125123
}
126124

127-
dependencies {
128-
coreLibraryDesugaring(libs.desugar.jdk.libs)
129-
}
130-
131125
mavenPublishing {
132126
publishToMavenCentral()
133127
signAllPublications()

sqllin-driver/src/commonTest/kotlin/com/ctrip/sqllin/driver/CommonBasicTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.ctrip.sqllin.driver
1818

1919
import kotlinx.coroutines.*
20+
import kotlinx.coroutines.test.runTest
2021
import kotlin.test.assertEquals
2122

2223
/**
@@ -194,7 +195,7 @@ class CommonBasicTest(private val path: DatabasePath) {
194195
}
195196

196197
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
197-
fun testConcurrency() = runBlocking {
198+
fun testConcurrency() = runTest {
198199
val readWriteConfig = getDefaultDBConfig(false)
199200
openDatabase(readWriteConfig) {
200201
launch(newSingleThreadContext("test0")) {

sqllin-dsl-test/build.gradle.kts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ kotlin {
6666
dependencies {
6767
implementation(project(":sqllin-dsl"))
6868
implementation(libs.kotlinx.serialization)
69-
implementation(libs.kotlinx.coroutines)
69+
implementation(libs.kotlinx.coroutines.core)
7070
}
7171
}
7272
commonTest.dependencies {
7373
implementation(kotlin("test"))
74+
implementation(libs.kotlinx.coroutines.test)
7475
}
7576
androidInstrumentedTest {
7677
dependencies {
@@ -89,9 +90,6 @@ android {
8990
minSdk = libs.versions.android.sdk.min.get().toInt()
9091
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
9192
}
92-
compileOptions {
93-
isCoreLibraryDesugaringEnabled = true
94-
}
9593
}
9694

9795
fun KotlinNativeTarget.setupNativeConfig() {
@@ -107,7 +105,6 @@ fun KotlinNativeTarget.setupNativeConfig() {
107105
}
108106

109107
dependencies {
110-
coreLibraryDesugaring(libs.desugar.jdk.libs)
111108
add("kspCommonMainMetadata", project(":sqllin-processor"))
112109
}
113110

sqllin-dsl-test/src/commonTest/kotlin/com/ctrip/sqllin/dsl/test/CommonBasicTest.kt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ import com.ctrip.sqllin.dsl.sql.clause.*
2424
import com.ctrip.sqllin.dsl.sql.clause.OrderByWay.ASC
2525
import com.ctrip.sqllin.dsl.sql.clause.OrderByWay.DESC
2626
import com.ctrip.sqllin.dsl.sql.statement.SelectStatement
27-
import kotlinx.coroutines.Dispatchers
27+
import kotlinx.coroutines.DelicateCoroutinesApi
28+
import kotlinx.coroutines.ExperimentalCoroutinesApi
2829
import kotlinx.coroutines.launch
29-
import kotlinx.coroutines.runBlocking
30+
import kotlinx.coroutines.newSingleThreadContext
31+
import kotlinx.coroutines.test.runTest
3032
import kotlin.test.assertEquals
3133
import kotlin.test.assertNotEquals
3234

@@ -77,7 +79,7 @@ class CommonBasicTest(private val path: DatabasePath) {
7779
}
7880
}
7981
assertEquals(true, statement!!.getResults().any { it == book1 })
80-
assertEquals(true, statement!!.getResults().any { it == book2 })
82+
assertEquals(true, statement.getResults().any { it == book2 })
8183

8284
var statement1: SelectStatement<Book>? = null
8385
var statement2: SelectStatement<Book>? = null
@@ -105,7 +107,7 @@ class CommonBasicTest(private val path: DatabasePath) {
105107
}
106108

107109
assertEquals(true, statement!!.getResults().any { it == book1 })
108-
assertEquals(true, statement!!.getResults().any { it == book2 })
110+
assertEquals(true, statement.getResults().any { it == book2 })
109111

110112
val book1NewPrice = 18.96
111113
val book2NewPrice = 21.95
@@ -124,7 +126,7 @@ class CommonBasicTest(private val path: DatabasePath) {
124126
}
125127

126128
assertEquals(true, newResult!!.getResults().any { it == newBook1 })
127-
assertEquals(true, newResult!!.getResults().any { it == newBook2 })
129+
assertEquals(true, newResult.getResults().any { it == newBook2 })
128130
}
129131

130132
fun testSelectWhereClause() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
@@ -281,10 +283,10 @@ class CommonBasicTest(private val path: DatabasePath) {
281283
}
282284
}
283285
assertEquals(7, statement!!.getResults().size)
284-
assertEquals(2, statement!!.getResults().count { it == book0 })
285-
assertEquals(2, statement!!.getResults().count { it == book1 })
286-
assertEquals(1, statement!!.getResults().count { it == book2 })
287-
assertEquals(2, statement!!.getResults().count { it == book3 })
286+
assertEquals(2, statement.getResults().count { it == book0 })
287+
assertEquals(2, statement.getResults().count { it == book1 })
288+
assertEquals(1, statement.getResults().count { it == book2 })
289+
assertEquals(2, statement.getResults().count { it == book3 })
288290
}
289291

290292
fun testFunction() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
@@ -370,11 +372,12 @@ class CommonBasicTest(private val path: DatabasePath) {
370372
assertEquals(outerJoinStatementWithOn?.getResults()?.size, books.size)
371373
}
372374

375+
@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)
373376
fun testConcurrency() = Database(getDefaultDBConfig(), true).databaseAutoClose { database ->
374-
runBlocking(Dispatchers.Default) {
377+
runTest {
375378
val book1 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = 16.96)
376379
val book2 = Book(name = "The Lost Symbol", author = "Dan Brown", pages = 510, price = 19.95)
377-
launch {
380+
launch(newSingleThreadContext("test0")) {
378381
lateinit var statement: SelectStatement<Book>
379382
database suspendedScope {
380383
statement = BookTable { table ->
@@ -385,7 +388,7 @@ class CommonBasicTest(private val path: DatabasePath) {
385388
assertEquals(true, statement.getResults().any { it == book1 })
386389
assertEquals(true, statement.getResults().any { it == book2 })
387390
}
388-
launch {
391+
launch(newSingleThreadContext("test1")) {
389392
val book1NewPrice = 18.96
390393
val book2NewPrice = 21.95
391394
val newBook1 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = book1NewPrice)
@@ -407,7 +410,7 @@ class CommonBasicTest(private val path: DatabasePath) {
407410

408411
fun testPrimitiveTypeForKSP() {
409412
TestPrimitiveTypeForKSPTable {
410-
SET<TestPrimitiveTypeForKSP> {
413+
SET {
411414
assertEquals(0, testInt)
412415
assertEquals(0L, testLong)
413416
assertEquals(0, testShort)

sqllin-dsl-test/src/jvmTest/kotlin/com/ctrip/sqllin/dsl/test/JvmTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class JvmTest {
4646
@Test
4747
fun testJoinClause() = commonTest.testJoinClause()
4848

49+
@Test
50+
fun testConcurrency() = commonTest.testConcurrency()
51+
4952
@Test
5053
fun testPrimitiveTypeForKSP() = commonTest.testPrimitiveTypeForKSP()
5154

sqllin-dsl/build.gradle.kts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ kotlin {
6161
commonMain.dependencies {
6262
api(project(":sqllin-driver"))
6363
implementation(libs.kotlinx.serialization)
64-
implementation(libs.kotlinx.coroutines)
64+
implementation(libs.kotlinx.coroutines.core)
6565
}
6666
}
6767
}
@@ -87,13 +87,6 @@ android {
8787
defaultConfig {
8888
minSdk = libs.versions.android.sdk.min.get().toInt()
8989
}
90-
compileOptions {
91-
isCoreLibraryDesugaringEnabled = true
92-
}
93-
}
94-
95-
dependencies {
96-
coreLibraryDesugaring(libs.desugar.jdk.libs)
9790
}
9891

9992
mavenPublishing {

0 commit comments

Comments
 (0)