diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f544ec0..3105435 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,14 +28,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -63,9 +63,6 @@ jobs: - name: Run sqllin-dsl JVM Unit Tests on macOS X64 run: ./test_dsl_jvm.sh - - name: Gradle Cache - uses: gradle/actions/setup-gradle@v3 - - name: AVD Cache uses: actions/cache@v4 id: avd-cache @@ -83,7 +80,7 @@ jobs: target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 11698152 + emulator-build: 12265550 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -96,7 +93,7 @@ jobs: target: google_apis arch: x86_64 profile: pixel_6 - emulator-build: 11698152 + emulator-build: 12265550 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -127,14 +124,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -187,14 +184,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -225,9 +222,6 @@ jobs: - name: Run sqllin-dsl JVM Unit Tests on Linux X64 run: ./test_dsl_jvm.sh - - name: Gradle Cache - uses: gradle/actions/setup-gradle@v3 - - name: AVD Cache uses: actions/cache@v4 id: avd-cache @@ -245,7 +239,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 - emulator-build: 11698152 + emulator-build: 12265550 force-avd-creation: false emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true @@ -258,7 +252,7 @@ jobs: target: default arch: x86_64 profile: pixel_2 - emulator-build: 11698152 + emulator-build: 12265550 force-avd-creation: false emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8ca4c7f..f1abe65 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,14 +23,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -46,9 +46,6 @@ jobs: - name: Build sqllin-dsl run: ./gradlew :sqllin-dsl:assemble -PonCICD - - name: Gradle Cache - uses: gradle/actions/setup-gradle@v3 - - name: Publish to MavenCentral run: ./publish_apple_android_jvm.sh @@ -63,14 +60,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -100,14 +97,14 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v3 - - name: Set up JDK 17 + - name: Set up JDK 21 uses: actions/setup-java@v4 with: distribution: 'zulu' - java-version: 17 + java-version: 21 - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 - name: Cache Build Tooling uses: actions/cache@v4 @@ -126,8 +123,5 @@ jobs: - name: Build sqllin-dsl run: ./gradlew :sqllin-dsl:assemble -PonCICD - - name: Gradle Cache - uses: gradle/actions/setup-gradle@v3 - - name: Publish to MavenCentral run: ./publish_linux_processor.sh diff --git a/.gitignore b/.gitignore index 0b69c74..e182c15 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ local.properties /sqllin-dsl/build /sqllin-processor/build /sample/build -*.podspec \ No newline at end of file +*.podspec +.kotlin \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a5e2a1b..0f2a24b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,16 +2,24 @@ - Date format: YYYY-MM-dd -## vx.x.x / 2024-xx-xx +## v1.4.0 / 2024-12-04 + +### All + +* Update `Kotlin`'s version to `2.1.00` ### sqllin-dsl -* Update `kotlinx.coroutines`'s version to `1.8.1` - +* Update `kotlinx.coroutines`'s version to `1.9.0` +* Update `kotlinx.serialization`'s version to `1.7.3` ### sqllin-driver -* Update the `sqlite-jdbc`'s version to `3.46.0.0` +* Update the `sqlite-jdbc`'s version to `3.47.1.0` + +### sqllin-processor + +* Update `KSP`'s version to `2.1.0-1.0.29` ## v1.3.2 / 2024-06-18 diff --git a/gradle.properties b/gradle.properties index 8710609..da47f61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION=1.3.2 +VERSION=1.4.0 GROUP=com.ctrip.kotlin #Maven Publish Information @@ -27,4 +27,5 @@ kotlin.code.style=official kotlin.mpp.stability.nowarn=true kotlin.mpp.enableCInteropCommonization=true kotlin.natvie.increment=true +#ksp.useKSP2=true #kotlin.compiler.execution.strategy=out-of-process \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8e6631e..8152c7c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,13 +1,14 @@ [versions] -kotlin = "1.9.24" -agp = "8.2.2" -ksp = "1.9.24-1.0.20" -serialization = "1.6.3" -coroutines = "1.8.1" -androidx-annotation = "1.8.0" +kotlin = "2.1.0" +agp = "8.7.3" +ksp = "2.1.0-1.0.29" +serialization = "1.7.3" +coroutines = "1.9.0" +androidx-annotation = "1.9.1" androidx-test = "1.6.1" -sqlite-jdbc = "3.46.0.0" +androidx-test-runner = "1.6.2" +sqlite-jdbc = "3.47.1.0" [libraries] @@ -18,13 +19,11 @@ kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutin androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" } androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidx-test" } -androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidx-test" } +androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidx-test-runner" } androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidx-test" } sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" } - - [plugins] kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } diff --git a/sample/build.gradle.kts b/sample/build.gradle.kts index b2603dc..8d788b0 100644 --- a/sample/build.gradle.kts +++ b/sample/build.gradle.kts @@ -1,4 +1,5 @@ -import org.jetbrains.kotlin.gradle.dsl.KotlinCompile +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask plugins { alias(libs.plugins.kotlin.multiplatform) @@ -14,21 +15,21 @@ kotlin { publishLibraryVariants("release") } jvm { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } + compilerOptions.jvmTarget.set(JvmTarget.JVM_11) } iosX64() iosArm64() iosSimulatorArm64() + + compilerOptions { + freeCompilerArgs.add("-Xexpect-actual-classes") + } sourceSets { all { languageSettings.optIn("kotlin.RequiresOptIn") } - val commonMain by getting { + commonMain { kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin") dependencies { implementation(project(":sqllin-dsl")) @@ -41,13 +42,13 @@ kotlin { android { namespace = "com.ctrip.sqllin.sample" - compileSdk = 34 + compileSdk = 35 defaultConfig { minSdk = 23 } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_21 } } @@ -55,15 +56,11 @@ dependencies { add("kspCommonMainMetadata", project(":sqllin-processor")) } -afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331 +afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331 tasks { - withType> { + withType> { if (name != "kspCommonMainKotlinMetadata") dependsOn("kspCommonMainKotlinMetadata") } } -} - -tasks.withType { - compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes") } \ No newline at end of file diff --git a/sqllin-driver/build.gradle.kts b/sqllin-driver/build.gradle.kts index 1dbb209..72424d6 100644 --- a/sqllin-driver/build.gradle.kts +++ b/sqllin-driver/build.gradle.kts @@ -1,4 +1,5 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import org.jetbrains.kotlin.konan.target.HostManager @@ -16,20 +17,16 @@ val VERSION: String by project group = GROUP version = VERSION +@OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { explicitApi() androidTarget { publishLibraryVariants("release") - @OptIn(ExperimentalKotlinGradlePluginApi::class) instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test) } jvm { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } + compilerOptions.jvmTarget.set(JvmTarget.JVM_11) } listOf( @@ -58,12 +55,8 @@ kotlin { it.setupNativeConfig() } - targets.configureEach { - compilations.configureEach { - compilerOptions.configure { - freeCompilerArgs.add("-Xexpect-actual-classes") - } - } + compilerOptions { + freeCompilerArgs.add("-Xexpect-actual-classes") } sourceSets { @@ -72,29 +65,20 @@ kotlin { optIn("kotlin.RequiresOptIn") } } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - implementation(libs.kotlinx.coroutines) - } + commonTest.dependencies { + implementation(kotlin("test")) + implementation(libs.kotlinx.coroutines) } - val androidMain by getting { - dependencies { - implementation(libs.androidx.annotation) - } + androidMain.dependencies { + implementation(libs.androidx.annotation) } - val androidInstrumentedTest by getting { - dependencies { - implementation(libs.androidx.test.core) - implementation(libs.androidx.test.runner) - implementation(libs.androidx.test.rules) - } + androidInstrumentedTest.dependencies { + implementation(libs.androidx.test.core) + implementation(libs.androidx.test.runner) + implementation(libs.androidx.test.rules) } - - val jvmMain by getting { - dependencies { - implementation(libs.sqlite.jdbc) - } + jvmMain.dependencies { + implementation(libs.sqlite.jdbc) } } } @@ -116,14 +100,14 @@ gradle.taskGraph.whenReady { android { namespace = "com.ctrip.sqllin.driver" - compileSdk = 34 + compileSdk = 35 defaultConfig { minSdk = 23 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_21 } } diff --git a/sqllin-dsl/build.gradle.kts b/sqllin-dsl/build.gradle.kts index 9b57215..cc2cb83 100644 --- a/sqllin-dsl/build.gradle.kts +++ b/sqllin-dsl/build.gradle.kts @@ -1,4 +1,6 @@ import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget import org.jetbrains.kotlin.konan.target.HostManager @@ -18,20 +20,16 @@ val VERSION: String by project group = GROUP version = VERSION +@OptIn(ExperimentalKotlinGradlePluginApi::class) kotlin { explicitApi() androidTarget { publishLibraryVariants("release") - @OptIn(ExperimentalKotlinGradlePluginApi::class) instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test) } jvm { - compilations.all { - kotlinOptions { - jvmTarget = "11" - } - } + compilerOptions.jvmTarget.set(JvmTarget.JVM_11) } listOf( @@ -60,12 +58,8 @@ kotlin { it.setupNativeConfig() } - targets.configureEach { - compilations.configureEach { - compilerOptions.configure { - freeCompilerArgs.add("-Xexpect-actual-classes") - } - } + compilerOptions { + freeCompilerArgs.add("-Xexpect-actual-classes") } sourceSets { @@ -74,28 +68,86 @@ kotlin { optIn("kotlin.RequiresOptIn") } } - val commonMain by getting { - dependencies { - api(project(":sqllin-driver")) - implementation(libs.kotlinx.serialization) - implementation(libs.kotlinx.coroutines) - } + commonMain.dependencies { + api(project(":sqllin-driver")) + implementation(libs.kotlinx.serialization) + implementation(libs.kotlinx.coroutines) } - val commonTest by getting { - dependencies { - implementation(kotlin("test")) - } + commonTest.dependencies { + implementation(kotlin("test")) } - val androidInstrumentedTest by getting { + androidInstrumentedTest { + setCommonTestDir() dependencies { implementation(libs.androidx.test.core) implementation(libs.androidx.test.runner) implementation(libs.androidx.test.rules) } } + jvmTest { + setCommonTestDir() + } + + iosX64Test { + setNativeTestDir() + } + iosArm64Test { + setNativeTestDir() + } + iosSimulatorArm64Test { + setNativeTestDir() + } + + + macosX64Test { + setNativeTestDir() + } + macosArm64Test { + setNativeTestDir() + } + + watchosX64Test { + setNativeTestDir() + } + watchosArm32Test { + setNativeTestDir() + } + watchosArm64Test { + setNativeTestDir() + } + watchosDeviceArm64Test { + setNativeTestDir() + } + watchosSimulatorArm64Test { + setNativeTestDir() + } + + tvosX64Test { + setNativeTestDir() + } + tvosArm64Test { + setNativeTestDir() + } + tvosSimulatorArm64Test { + setNativeTestDir() + } + + linuxX64Test { + setNativeTestDir() + } + linuxArm64Test { + setNativeTestDir() + } + + mingwX64Test { + setNativeTestDir() + } } } +fun KotlinSourceSet.setCommonTestDir(vararg path: String) = kotlin.srcDirs("src/commonTestCode/kotlin", path) +fun KotlinSourceSet.setNativeTestDir() = setCommonTestDir("src/nativeTestCode/kotlin") + gradle.taskGraph.whenReady { if (!project.hasProperty("onCICD")) return@whenReady @@ -113,14 +165,14 @@ gradle.taskGraph.whenReady { android { namespace = "com.ctrip.sqllin.dsl" - compileSdk = 34 + compileSdk = 35 defaultConfig { minSdk = 23 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } compileOptions { sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_21 } } @@ -137,7 +189,7 @@ fun KotlinNativeTarget.setupNativeConfig() { } dependencies { - val sourceSet = listOf( + val sourceSets = listOf( "kspAndroidAndroidTest", "kspJvmTest", @@ -152,6 +204,7 @@ dependencies { "kspWatchosX64Test", "kspWatchosArm32Test", "kspWatchosArm64Test", + "kspWatchosDeviceArm64Test", "kspWatchosSimulatorArm64Test", "kspTvosX64Test", @@ -159,10 +212,11 @@ dependencies { "kspTvosSimulatorArm64Test", "kspLinuxX64Test", + "kspLinuxArm64Test", "kspMingwX64Test", ) - sourceSet.forEach { + sourceSets.forEach { add(it, project(":sqllin-processor")) } } 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/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt b/sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt similarity index 100% rename from sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt rename to sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt diff --git a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/Entities.kt b/sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/Entities.kt similarity index 100% rename from sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/Entities.kt rename to sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/Entities.kt diff --git a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/TestPrimitiveTypeForKSP.kt b/sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/TestPrimitiveTypeForKSP.kt similarity index 100% rename from sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/TestPrimitiveTypeForKSP.kt rename to sqllin-dsl/src/commonTestCode/kotlin/com/ctrip/sqllin/dsl/TestPrimitiveTypeForKSP.kt 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/nativeTest/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/nativeTest/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/nativeTest/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 diff --git a/sqllin-dsl/src/nativeTest/kotlin/com/ctrip/sqllin/dsl/NativeTest.kt b/sqllin-dsl/src/nativeTestCode/kotlin/com/ctrip/sqllin/dsl/NativeTest.kt similarity index 100% rename from sqllin-dsl/src/nativeTest/kotlin/com/ctrip/sqllin/dsl/NativeTest.kt rename to sqllin-dsl/src/nativeTestCode/kotlin/com/ctrip/sqllin/dsl/NativeTest.kt diff --git a/sqllin-processor/build.gradle.kts b/sqllin-processor/build.gradle.kts index 5b0dd36..0f3855d 100644 --- a/sqllin-processor/build.gradle.kts +++ b/sqllin-processor/build.gradle.kts @@ -15,8 +15,8 @@ repositories { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } dependencies { diff --git a/sqllin-processor/src/main/kotlin/com/ctrip/sqllin/processor/ClauseProcessor.kt b/sqllin-processor/src/main/kotlin/com/ctrip/sqllin/processor/ClauseProcessor.kt index 8784114..83cef04 100644 --- a/sqllin-processor/src/main/kotlin/com/ctrip/sqllin/processor/ClauseProcessor.kt +++ b/sqllin-processor/src/main/kotlin/com/ctrip/sqllin/processor/ClauseProcessor.kt @@ -51,7 +51,7 @@ class ClauseProcessor( for (classDeclaration in validateDBRowClasses) { if (classDeclaration.annotations.all { !it.annotationType.resolve().isAssignableFrom(serializableType) }) - continue // Don't handle the class that don't annotated 'Serializable' + continue // Don't handle the classes that didn't be annotated 'Serializable' val className = classDeclaration.simpleName.asString() val packageName = classDeclaration.packageName.asString()