Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the version of Kotlin to 1.9.20 #56

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@

## v1.2.2 / 2023-xx-xx

### All

* Update `Kotlin`'s version to `1.9.20`

### sqllin-dsl

* Add the new API `Database#suspendedScope`, it could be used to ensure concurrency safety
* Add the new API `Database#suspendedScope`, it could be used to ensure concurrency safety([#55](https://github.com/ctripcorp/SQLlin/pull/55))
* Begin with this version, _sqllin-dsl_ depends on _kotlinx.coroutines_ version `1.7.3`
* ***Breaking change***: Remove the public class `DBEntity`, we have deprecated it in version `1.1.1`

### sqllin-processor

* Update `KSP`'s version to `1.9.20-1.0.13`

## v1.2.1 / 2023-10-18

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

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

## v1.1.1 / 2023-08-12
Expand Down
5 changes: 3 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
VERSION=1.2.1
GROUP=com.ctrip.kotlin

kotlinVersion=1.9.10
kspVersion=1.9.10-1.0.13
kotlinVersion=1.9.20
kspVersion=1.9.20-1.0.13
coroutinesVersion=1.7.3

#Maven Publish Information
Expand Down Expand Up @@ -31,4 +31,5 @@ android.disableAutomaticComponentCreation=true
kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.natvie.increment=true
#kotlin.compiler.execution.strategy=out-of-process
33 changes: 7 additions & 26 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
kotlin("multiplatform")
Expand All @@ -21,15 +20,9 @@ kotlin {
}
}
}
iosX64 {
setupIOSConfig()
}
iosArm64 {
setupIOSConfig()
}
iosSimulatorArm64 {
setupIOSConfig()
}
iosX64()
iosArm64()
iosSimulatorArm64()

sourceSets {
all {
Expand All @@ -44,17 +37,6 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
}
}
val androidMain by getting
val jvmMain by getting
val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting
val iosMain by creating {
dependsOn(commonMain)
iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)
}
}
}

Expand All @@ -70,11 +52,6 @@ android {
}
}

fun KotlinNativeTarget.setupIOSConfig() {
val compileArgs = listOf("-Xallocator=mimalloc", "-Xruntime-logs=gc=info")
compilations["main"].kotlinOptions.freeCompilerArgs += compileArgs
}

dependencies {
add("kspCommonMainMetadata", project(":sqllin-processor"))
}
Expand All @@ -86,4 +63,8 @@ afterEvaluate { // WORKAROUND: both register() and named() fail – https://git
dependsOn("kspCommonMainKotlinMetadata")
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
}
135 changes: 9 additions & 126 deletions sqllin-driver/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.konan.target.HostManager

plugins {
Expand All @@ -18,6 +21,8 @@ kotlin {
explicitApi()
androidTarget {
publishLibraryVariants("release")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
}

jvm {
Expand Down Expand Up @@ -59,7 +64,6 @@ kotlin {
optIn("kotlin.RequiresOptIn")
}
}
val commonMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
Expand All @@ -73,7 +77,6 @@ kotlin {
}
}
val androidInstrumentedTest by getting {
dependsOn(commonTest)
dependencies {
implementation("androidx.test:core:1.5.0")
implementation("androidx.test:runner:1.5.2")
Expand All @@ -86,124 +89,6 @@ kotlin {
implementation("org.xerial:sqlite-jdbc:3.43.0.0")
}
}

val jvmTest by getting

val iosX64Main by getting
val iosArm64Main by getting
val iosSimulatorArm64Main by getting

val macosX64Main by getting
val macosArm64Main by getting

val watchosX64Main by getting
val watchosArm32Main by getting
val watchosArm64Main by getting
val watchosSimulatorArm64Main by getting
val watchosDeviceArm64Main by getting

val tvosX64Main by getting
val tvosArm64Main by getting
val tvosSimulatorArm64Main by getting

val linuxX64Main by getting

val mingwX64Main by getting

val nativeMain by creating {
dependsOn(commonMain)
}

val appleMain by creating {
dependsOn(nativeMain)

iosX64Main.dependsOn(this)
iosArm64Main.dependsOn(this)
iosSimulatorArm64Main.dependsOn(this)

macosX64Main.dependsOn(this)
macosArm64Main.dependsOn(this)

watchosX64Main.dependsOn(this)
watchosArm32Main.dependsOn(this)
watchosArm64Main.dependsOn(this)
watchosSimulatorArm64Main.dependsOn(this)
watchosDeviceArm64Main.dependsOn(this)

tvosX64Main.dependsOn(this)
tvosArm64Main.dependsOn(this)
tvosSimulatorArm64Main.dependsOn(this)
}

val linuxMain by creating {
dependsOn(nativeMain)

linuxX64Main.dependsOn(this)
}

val mingwMain by creating {
dependsOn(nativeMain)

mingwX64Main.dependsOn(this)
}

val iosX64Test by getting
val iosArm64Test by getting
val iosSimulatorArm64Test by getting

val macosX64Test by getting
val macosArm64Test by getting

val watchosX64Test by getting
val watchosArm32Test by getting
val watchosArm64Test by getting
val watchosSimulatorArm64Test by getting
val watchosDeviceArm64Test by getting

val tvosX64Test by getting
val tvosArm64Test by getting
val tvosSimulatorArm64Test by getting

val linuxX64Test by getting

val mingwX64Test by getting

val nativeTest by creating {
dependsOn(commonTest)
}

val appleTest by creating {
dependsOn(nativeTest)

iosX64Test.dependsOn(this)
iosArm64Test.dependsOn(this)
iosSimulatorArm64Test.dependsOn(this)

macosX64Test.dependsOn(this)
macosArm64Test.dependsOn(this)

watchosX64Test.dependsOn(this)
watchosArm32Test.dependsOn(this)
watchosArm64Test.dependsOn(this)
watchosSimulatorArm64Test.dependsOn(this)
watchosDeviceArm64Test.dependsOn(this)

tvosX64Test.dependsOn(this)
tvosArm64Test.dependsOn(this)
tvosSimulatorArm64Test.dependsOn(this)
}

val linuxTest by creating {
dependsOn(nativeTest)

linuxX64Test.dependsOn(this)
}

val mingwTest by creating {
dependsOn(nativeTest)

mingwX64Test.dependsOn(this)
}
}

tasks.findByName("publishLinuxX64PublicationToMavenRepository")?.enabled = HostManager.hostIsLinux
Expand All @@ -217,12 +102,6 @@ android {
minSdk = 23
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
unitTests {
isReturnDefaultValues = true
isIncludeAndroidResources = true
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -300,4 +179,8 @@ publishing {
useInMemoryPgpKeys(SIGNING_KEY_ID, SIGNING_KEY, SIGNING_PASSWORD)
sign(publishing.publications)
}
}

tasks.withType<KotlinCompile> {
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
}
2 changes: 2 additions & 0 deletions sqllin-driver/src/nativeInterop/cinterop/sqlite3.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ linkerOpts.macos_x64 = -lpthread -ldl
linkerOpts.macos_arm64 = -lpthread -ldl

noStringConversion = sqlite3_prepare_v2 sqlite3_prepare_v3

userSetupHint = message
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@

package com.ctrip.sqllin.driver.cinterop

import kotlinx.cinterop.ExperimentalForeignApi

/**
* The result codes Enum
* @author yaqiao
*/

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

Expand Down
Loading
Loading