Skip to content

Commit 649bcc1

Browse files
authored
Merge pull request #56 from qiaoyuang/main
Update the version of Kotlin to 1.9.20
2 parents de66ddc + 1ec121c commit 649bcc1

File tree

8 files changed

+44
-301
lines changed

8 files changed

+44
-301
lines changed

CHANGELOG.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
44

55
## v1.2.2 / 2023-xx-xx
66

7+
### All
8+
9+
* Update `Kotlin`'s version to `1.9.20`
10+
711
### sqllin-dsl
812

9-
* Add the new API `Database#suspendedScope`, it could be used to ensure concurrency safety
13+
* Add the new API `Database#suspendedScope`, it could be used to ensure concurrency safety([#55](https://github.com/ctripcorp/SQLlin/pull/55))
1014
* Begin with this version, _sqllin-dsl_ depends on _kotlinx.coroutines_ version `1.7.3`
15+
* ***Breaking change***: Remove the public class `DBEntity`, we have deprecated it in version `1.1.1`
16+
17+
### sqllin-processor
18+
19+
* Update `KSP`'s version to `1.9.20-1.0.13`
1120

1221
## v1.2.1 / 2023-10-18
1322

@@ -37,7 +46,7 @@ a runtime exception. Thanks for [@nbransby](https://github.com/nbransby)
3746
### sqllin-driver
3847

3948
* Add the new JVM target
40-
* Breaking change: Remove the public property: `DatabaseConnection#closed`
49+
* ***Breaking change***: Remove the public property: `DatabaseConnection#closed`
4150
* The Android (<= 9) target supports to set the `journalMode` and `synchronousMode` now
4251

4352
## v1.1.1 / 2023-08-12

gradle.properties

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
VERSION=1.2.1
22
GROUP=com.ctrip.kotlin
33

4-
kotlinVersion=1.9.10
5-
kspVersion=1.9.10-1.0.13
4+
kotlinVersion=1.9.20
5+
kspVersion=1.9.20-1.0.13
66
coroutinesVersion=1.7.3
77

88
#Maven Publish Information
@@ -31,4 +31,5 @@ android.disableAutomaticComponentCreation=true
3131
kotlin.code.style=official
3232
kotlin.mpp.stability.nowarn=true
3333
kotlin.mpp.enableCInteropCommonization=true
34+
kotlin.natvie.increment=true
3435
#kotlin.compiler.execution.strategy=out-of-process

sample/build.gradle.kts

+7-26
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
2-
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
32

43
plugins {
54
kotlin("multiplatform")
@@ -21,15 +20,9 @@ kotlin {
2120
}
2221
}
2322
}
24-
iosX64 {
25-
setupIOSConfig()
26-
}
27-
iosArm64 {
28-
setupIOSConfig()
29-
}
30-
iosSimulatorArm64 {
31-
setupIOSConfig()
32-
}
23+
iosX64()
24+
iosArm64()
25+
iosSimulatorArm64()
3326

3427
sourceSets {
3528
all {
@@ -44,17 +37,6 @@ kotlin {
4437
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
4538
}
4639
}
47-
val androidMain by getting
48-
val jvmMain by getting
49-
val iosX64Main by getting
50-
val iosArm64Main by getting
51-
val iosSimulatorArm64Main by getting
52-
val iosMain by creating {
53-
dependsOn(commonMain)
54-
iosX64Main.dependsOn(this)
55-
iosArm64Main.dependsOn(this)
56-
iosSimulatorArm64Main.dependsOn(this)
57-
}
5840
}
5941
}
6042

@@ -70,11 +52,6 @@ android {
7052
}
7153
}
7254

73-
fun KotlinNativeTarget.setupIOSConfig() {
74-
val compileArgs = listOf("-Xallocator=mimalloc", "-Xruntime-logs=gc=info")
75-
compilations["main"].kotlinOptions.freeCompilerArgs += compileArgs
76-
}
77-
7855
dependencies {
7956
add("kspCommonMainMetadata", project(":sqllin-processor"))
8057
}
@@ -86,4 +63,8 @@ afterEvaluate { // WORKAROUND: both register() and named() fail – https://git
8663
dependsOn("kspCommonMainKotlinMetadata")
8764
}
8865
}
66+
}
67+
68+
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
69+
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
8970
}

sqllin-driver/build.gradle.kts

+9-126
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
13
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
25
import org.jetbrains.kotlin.konan.target.HostManager
36

47
plugins {
@@ -18,6 +21,8 @@ kotlin {
1821
explicitApi()
1922
androidTarget {
2023
publishLibraryVariants("release")
24+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
25+
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
2126
}
2227

2328
jvm {
@@ -59,7 +64,6 @@ kotlin {
5964
optIn("kotlin.RequiresOptIn")
6065
}
6166
}
62-
val commonMain by getting
6367
val commonTest by getting {
6468
dependencies {
6569
implementation(kotlin("test"))
@@ -73,7 +77,6 @@ kotlin {
7377
}
7478
}
7579
val androidInstrumentedTest by getting {
76-
dependsOn(commonTest)
7780
dependencies {
7881
implementation("androidx.test:core:1.5.0")
7982
implementation("androidx.test:runner:1.5.2")
@@ -86,124 +89,6 @@ kotlin {
8689
implementation("org.xerial:sqlite-jdbc:3.43.0.0")
8790
}
8891
}
89-
90-
val jvmTest by getting
91-
92-
val iosX64Main by getting
93-
val iosArm64Main by getting
94-
val iosSimulatorArm64Main by getting
95-
96-
val macosX64Main by getting
97-
val macosArm64Main by getting
98-
99-
val watchosX64Main by getting
100-
val watchosArm32Main by getting
101-
val watchosArm64Main by getting
102-
val watchosSimulatorArm64Main by getting
103-
val watchosDeviceArm64Main by getting
104-
105-
val tvosX64Main by getting
106-
val tvosArm64Main by getting
107-
val tvosSimulatorArm64Main by getting
108-
109-
val linuxX64Main by getting
110-
111-
val mingwX64Main by getting
112-
113-
val nativeMain by creating {
114-
dependsOn(commonMain)
115-
}
116-
117-
val appleMain by creating {
118-
dependsOn(nativeMain)
119-
120-
iosX64Main.dependsOn(this)
121-
iosArm64Main.dependsOn(this)
122-
iosSimulatorArm64Main.dependsOn(this)
123-
124-
macosX64Main.dependsOn(this)
125-
macosArm64Main.dependsOn(this)
126-
127-
watchosX64Main.dependsOn(this)
128-
watchosArm32Main.dependsOn(this)
129-
watchosArm64Main.dependsOn(this)
130-
watchosSimulatorArm64Main.dependsOn(this)
131-
watchosDeviceArm64Main.dependsOn(this)
132-
133-
tvosX64Main.dependsOn(this)
134-
tvosArm64Main.dependsOn(this)
135-
tvosSimulatorArm64Main.dependsOn(this)
136-
}
137-
138-
val linuxMain by creating {
139-
dependsOn(nativeMain)
140-
141-
linuxX64Main.dependsOn(this)
142-
}
143-
144-
val mingwMain by creating {
145-
dependsOn(nativeMain)
146-
147-
mingwX64Main.dependsOn(this)
148-
}
149-
150-
val iosX64Test by getting
151-
val iosArm64Test by getting
152-
val iosSimulatorArm64Test by getting
153-
154-
val macosX64Test by getting
155-
val macosArm64Test by getting
156-
157-
val watchosX64Test by getting
158-
val watchosArm32Test by getting
159-
val watchosArm64Test by getting
160-
val watchosSimulatorArm64Test by getting
161-
val watchosDeviceArm64Test by getting
162-
163-
val tvosX64Test by getting
164-
val tvosArm64Test by getting
165-
val tvosSimulatorArm64Test by getting
166-
167-
val linuxX64Test by getting
168-
169-
val mingwX64Test by getting
170-
171-
val nativeTest by creating {
172-
dependsOn(commonTest)
173-
}
174-
175-
val appleTest by creating {
176-
dependsOn(nativeTest)
177-
178-
iosX64Test.dependsOn(this)
179-
iosArm64Test.dependsOn(this)
180-
iosSimulatorArm64Test.dependsOn(this)
181-
182-
macosX64Test.dependsOn(this)
183-
macosArm64Test.dependsOn(this)
184-
185-
watchosX64Test.dependsOn(this)
186-
watchosArm32Test.dependsOn(this)
187-
watchosArm64Test.dependsOn(this)
188-
watchosSimulatorArm64Test.dependsOn(this)
189-
watchosDeviceArm64Test.dependsOn(this)
190-
191-
tvosX64Test.dependsOn(this)
192-
tvosArm64Test.dependsOn(this)
193-
tvosSimulatorArm64Test.dependsOn(this)
194-
}
195-
196-
val linuxTest by creating {
197-
dependsOn(nativeTest)
198-
199-
linuxX64Test.dependsOn(this)
200-
}
201-
202-
val mingwTest by creating {
203-
dependsOn(nativeTest)
204-
205-
mingwX64Test.dependsOn(this)
206-
}
20792
}
20893

20994
tasks.findByName("publishLinuxX64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
@@ -217,12 +102,6 @@ android {
217102
minSdk = 23
218103
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
219104
}
220-
testOptions {
221-
unitTests {
222-
isReturnDefaultValues = true
223-
isIncludeAndroidResources = true
224-
}
225-
}
226105
compileOptions {
227106
sourceCompatibility = JavaVersion.VERSION_11
228107
targetCompatibility = JavaVersion.VERSION_17
@@ -300,4 +179,8 @@ publishing {
300179
useInMemoryPgpKeys(SIGNING_KEY_ID, SIGNING_KEY, SIGNING_PASSWORD)
301180
sign(publishing.publications)
302181
}
182+
}
183+
184+
tasks.withType<KotlinCompile> {
185+
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
303186
}

sqllin-driver/src/nativeInterop/cinterop/sqlite3.def

+2
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ linkerOpts.macos_x64 = -lpthread -ldl
77
linkerOpts.macos_arm64 = -lpthread -ldl
88

99
noStringConversion = sqlite3_prepare_v2 sqlite3_prepare_v3
10+
11+
userSetupHint = message

sqllin-driver/src/nativeMain/kotlin/com/ctrip/sqllin/driver/cinterop/SQLiteErrorType.kt

+3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616

1717
package com.ctrip.sqllin.driver.cinterop
1818

19+
import kotlinx.cinterop.ExperimentalForeignApi
20+
1921
/**
2022
* The result codes Enum
2123
* @author yaqiao
2224
*/
2325

26+
@OptIn(ExperimentalForeignApi::class)
2427
internal enum class SQLiteErrorType(val code: Int) {
2528
SQLITE_OK(com.ctrip.sqllin.sqlite3.SQLITE_OK), /* Successful result */
2629

0 commit comments

Comments
 (0)