From b61d6c83366e00dc1afcf06a587a64c6586e6aa3 Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Wed, 4 Dec 2024 19:48:39 +0000 Subject: [PATCH] Fix the native unit tests --- gradle.properties | 2 +- sqllin-dsl/doc/getting-start-cn.md | 6 +++--- sqllin-dsl/doc/getting-start.md | 6 +++--- .../kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt | 4 ++-- .../kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt | 4 ++-- .../kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt | 4 ++-- .../kotlin/com/ctrip/sqllin/dsl/Platform.kt | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) rename sqllin-dsl/src/{appleTest => appleMain}/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt (91%) rename sqllin-dsl/src/{linuxTest => linuxMain}/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt (90%) rename sqllin-dsl/src/{mingwTest => mingwMain}/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt (91%) rename sqllin-dsl/src/{nativeTestCode => nativeMain}/kotlin/com/ctrip/sqllin/dsl/Platform.kt (90%) diff --git a/gradle.properties b/gradle.properties index f91490f..da47f61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,5 +27,5 @@ kotlin.code.style=official kotlin.mpp.stability.nowarn=true kotlin.mpp.enableCInteropCommonization=true kotlin.natvie.increment=true -ksp.useKSP2=true +#ksp.useKSP2=true #kotlin.compiler.execution.strategy=out-of-process \ No newline at end of file diff --git a/sqllin-dsl/doc/getting-start-cn.md b/sqllin-dsl/doc/getting-start-cn.md index 88b3e63..6b34571 100644 --- a/sqllin-dsl/doc/getting-start-cn.md +++ b/sqllin-dsl/doc/getting-start-cn.md @@ -14,7 +14,7 @@ plugins { id("com.google.devtools.ksp") } -val sqllinVersion = "1.3.1" +val sqllinVersion = "1.4.0" kotlin { // ...... @@ -28,10 +28,10 @@ kotlin { implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion") // The sqllin-dsl serialization and deserialization depends on kotlinx-serialization - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3") // Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") } } // ...... diff --git a/sqllin-dsl/doc/getting-start.md b/sqllin-dsl/doc/getting-start.md index 26eda6c..9f50c5f 100644 --- a/sqllin-dsl/doc/getting-start.md +++ b/sqllin-dsl/doc/getting-start.md @@ -16,7 +16,7 @@ plugins { id("com.google.devtools.ksp") } -val sqllinVersion = "1.3.1" +val sqllinVersion = "1.4.0" kotlin { // ...... @@ -30,10 +30,10 @@ kotlin { implementation("com.ctrip.kotlin:sqllin-driver:$sqllinVersion") // The sqllin-dsl serialization and deserialization depends on kotlinx-serialization - implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.3") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:1.7.3") // Since 1.2.2, sqllin-dsl depends on kotlinx.coroutines - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0") } } // ...... diff --git a/sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt b/sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt similarity index 91% rename from sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt rename to sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt index f42911e..66a1f2b 100644 --- a/sqllin-dsl/src/appleTest/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt +++ b/sqllin-dsl/src/appleMain/kotlin/com/ctrip/sqllin/dsl/PlatformApple.kt @@ -27,7 +27,7 @@ import platform.Foundation.NSUserDomainMask */ @OptIn(UnsafeNumber::class) -actual fun getPlatformStringPath(): String = +internal actual fun getPlatformStringPath(): String = (NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true).firstOrNull() as? String ?: "") -actual val pathSeparator: Char = '/' \ No newline at end of file +// actual val pathSeparator: Char = '/' \ No newline at end of file diff --git a/sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt b/sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt similarity index 90% rename from sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt rename to sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt index 27a7331..29ce773 100644 --- a/sqllin-dsl/src/linuxTest/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt +++ b/sqllin-dsl/src/linuxMain/kotlin/com/ctrip/sqllin/dsl/PlatformLinux.kt @@ -26,7 +26,7 @@ import platform.posix.getcwd */ @OptIn(ExperimentalForeignApi::class) -actual fun getPlatformStringPath(): String = +internal actual fun getPlatformStringPath(): String = getcwd(null, 0u)?.toKString() ?: throw IllegalStateException("The temp path created error") -actual val pathSeparator: Char = '/' \ No newline at end of file +// actual val pathSeparator: Char = '/' \ No newline at end of file diff --git a/sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt b/sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt similarity index 91% rename from sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt rename to sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt index 7d027f1..f3ae026 100644 --- a/sqllin-dsl/src/mingwTest/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt +++ b/sqllin-dsl/src/mingwMain/kotlin/com/ctrip/sqllin/dsl/PlatformMingw.kt @@ -26,7 +26,7 @@ import platform.posix._wgetcwd */ @OptIn(ExperimentalForeignApi::class) -actual fun getPlatformStringPath(): String = +internal actual fun getPlatformStringPath(): String = _wgetcwd(null, 0)?.toKString() ?: throw IllegalStateException("Get database path wrong") -actual val pathSeparator: Char = '\\' \ No newline at end of file +// actual val pathSeparator: Char = '\\' \ No newline at end of file diff --git a/sqllin-dsl/src/nativeTestCode/kotlin/com/ctrip/sqllin/dsl/Platform.kt b/sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt similarity index 90% rename from sqllin-dsl/src/nativeTestCode/kotlin/com/ctrip/sqllin/dsl/Platform.kt rename to sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt index a9ee933..1b7a5b3 100644 --- a/sqllin-dsl/src/nativeTestCode/kotlin/com/ctrip/sqllin/dsl/Platform.kt +++ b/sqllin-dsl/src/nativeMain/kotlin/com/ctrip/sqllin/dsl/Platform.kt @@ -24,9 +24,9 @@ package com.ctrip.sqllin.dsl /** * Get the DatabasePath */ -expect fun getPlatformStringPath(): String +internal expect fun getPlatformStringPath(): String /** * Get the file path separator, '\' in Windows, '/' in others */ -expect val pathSeparator: Char \ No newline at end of file +// expect val pathSeparator: Char \ No newline at end of file