Skip to content

Commit cf1f01c

Browse files
authored
Merge pull request #100 from qiaoyuang/main
Update to K2
2 parents 1868940 + b61d6c8 commit cf1f01c

File tree

21 files changed

+175
-143
lines changed

21 files changed

+175
-143
lines changed

.github/workflows/build.yml

+13-19
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
- name: Validate Gradle Wrapper
2929
uses: gradle/wrapper-validation-action@v3
3030

31-
- name: Set up JDK 17
31+
- name: Set up JDK 21
3232
uses: actions/setup-java@v4
3333
with:
3434
distribution: 'zulu'
35-
java-version: 17
35+
java-version: 21
3636

3737
- name: Setup Gradle
38-
uses: gradle/actions/setup-gradle@v3
38+
uses: gradle/actions/setup-gradle@v4
3939

4040
- name: Cache Build Tooling
4141
uses: actions/cache@v4
@@ -63,9 +63,6 @@ jobs:
6363
- name: Run sqllin-dsl JVM Unit Tests on macOS X64
6464
run: ./test_dsl_jvm.sh
6565

66-
- name: Gradle Cache
67-
uses: gradle/actions/setup-gradle@v3
68-
6966
- name: AVD Cache
7067
uses: actions/cache@v4
7168
id: avd-cache
@@ -83,7 +80,7 @@ jobs:
8380
target: google_apis
8481
arch: x86_64
8582
profile: pixel_6
86-
emulator-build: 11698152
83+
emulator-build: 12265550
8784
force-avd-creation: false
8885
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
8986
disable-animations: true
@@ -96,7 +93,7 @@ jobs:
9693
target: google_apis
9794
arch: x86_64
9895
profile: pixel_6
99-
emulator-build: 11698152
96+
emulator-build: 12265550
10097
force-avd-creation: false
10198
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
10299
disable-animations: true
@@ -127,14 +124,14 @@ jobs:
127124
- name: Validate Gradle Wrapper
128125
uses: gradle/wrapper-validation-action@v3
129126

130-
- name: Set up JDK 17
127+
- name: Set up JDK 21
131128
uses: actions/setup-java@v4
132129
with:
133130
distribution: 'zulu'
134-
java-version: 17
131+
java-version: 21
135132

136133
- name: Setup Gradle
137-
uses: gradle/actions/setup-gradle@v3
134+
uses: gradle/actions/setup-gradle@v4
138135

139136
- name: Cache Build Tooling
140137
uses: actions/cache@v4
@@ -187,14 +184,14 @@ jobs:
187184
- name: Validate Gradle Wrapper
188185
uses: gradle/wrapper-validation-action@v3
189186

190-
- name: Set up JDK 17
187+
- name: Set up JDK 21
191188
uses: actions/setup-java@v4
192189
with:
193190
distribution: 'zulu'
194-
java-version: 17
191+
java-version: 21
195192

196193
- name: Setup Gradle
197-
uses: gradle/actions/setup-gradle@v3
194+
uses: gradle/actions/setup-gradle@v4
198195

199196
- name: Cache Build Tooling
200197
uses: actions/cache@v4
@@ -225,9 +222,6 @@ jobs:
225222
- name: Run sqllin-dsl JVM Unit Tests on Linux X64
226223
run: ./test_dsl_jvm.sh
227224

228-
- name: Gradle Cache
229-
uses: gradle/actions/setup-gradle@v3
230-
231225
- name: AVD Cache
232226
uses: actions/cache@v4
233227
id: avd-cache
@@ -245,7 +239,7 @@ jobs:
245239
target: default
246240
arch: x86_64
247241
profile: pixel_2
248-
emulator-build: 11698152
242+
emulator-build: 12265550
249243
force-avd-creation: false
250244
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
251245
disable-animations: true
@@ -258,7 +252,7 @@ jobs:
258252
target: default
259253
arch: x86_64
260254
profile: pixel_2
261-
emulator-build: 11698152
255+
emulator-build: 12265550
262256
force-avd-creation: false
263257
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
264258
disable-animations: true

.github/workflows/publish.yml

+9-15
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ jobs:
2323
- name: Validate Gradle Wrapper
2424
uses: gradle/wrapper-validation-action@v3
2525

26-
- name: Set up JDK 17
26+
- name: Set up JDK 21
2727
uses: actions/setup-java@v4
2828
with:
2929
distribution: 'zulu'
30-
java-version: 17
30+
java-version: 21
3131

3232
- name: Setup Gradle
33-
uses: gradle/actions/setup-gradle@v3
33+
uses: gradle/actions/setup-gradle@v4
3434

3535
- name: Cache Build Tooling
3636
uses: actions/cache@v4
@@ -46,9 +46,6 @@ jobs:
4646
- name: Build sqllin-dsl
4747
run: ./gradlew :sqllin-dsl:assemble -PonCICD
4848

49-
- name: Gradle Cache
50-
uses: gradle/actions/setup-gradle@v3
51-
5249
- name: Publish to MavenCentral
5350
run: ./publish_apple_android_jvm.sh
5451

@@ -63,14 +60,14 @@ jobs:
6360
- name: Validate Gradle Wrapper
6461
uses: gradle/wrapper-validation-action@v3
6562

66-
- name: Set up JDK 17
63+
- name: Set up JDK 21
6764
uses: actions/setup-java@v4
6865
with:
6966
distribution: 'zulu'
70-
java-version: 17
67+
java-version: 21
7168

7269
- name: Setup Gradle
73-
uses: gradle/actions/setup-gradle@v3
70+
uses: gradle/actions/setup-gradle@v4
7471

7572
- name: Cache Build Tooling
7673
uses: actions/cache@v4
@@ -100,14 +97,14 @@ jobs:
10097
- name: Validate Gradle Wrapper
10198
uses: gradle/wrapper-validation-action@v3
10299

103-
- name: Set up JDK 17
100+
- name: Set up JDK 21
104101
uses: actions/setup-java@v4
105102
with:
106103
distribution: 'zulu'
107-
java-version: 17
104+
java-version: 21
108105

109106
- name: Setup Gradle
110-
uses: gradle/actions/setup-gradle@v3
107+
uses: gradle/actions/setup-gradle@v4
111108

112109
- name: Cache Build Tooling
113110
uses: actions/cache@v4
@@ -126,8 +123,5 @@ jobs:
126123
- name: Build sqllin-dsl
127124
run: ./gradlew :sqllin-dsl:assemble -PonCICD
128125

129-
- name: Gradle Cache
130-
uses: gradle/actions/setup-gradle@v3
131-
132126
- name: Publish to MavenCentral
133127
run: ./publish_linux_processor.sh

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ local.properties
1313
/sqllin-dsl/build
1414
/sqllin-processor/build
1515
/sample/build
16-
*.podspec
16+
*.podspec
17+
.kotlin

CHANGELOG.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,24 @@
22

33
- Date format: YYYY-MM-dd
44

5-
## vx.x.x / 2024-xx-xx
5+
## v1.4.0 / 2024-12-04
6+
7+
### All
8+
9+
* Update `Kotlin`'s version to `2.1.00`
610

711
### sqllin-dsl
812

9-
* Update `kotlinx.coroutines`'s version to `1.8.1`
10-
<!--* Update `kotlinx.serialization`'s version to `1.7.1`-->
13+
* Update `kotlinx.coroutines`'s version to `1.9.0`
14+
* Update `kotlinx.serialization`'s version to `1.7.3`
1115

1216
### sqllin-driver
1317

14-
* Update the `sqlite-jdbc`'s version to `3.46.0.0`
18+
* Update the `sqlite-jdbc`'s version to `3.47.1.0`
19+
20+
### sqllin-processor
21+
22+
* Update `KSP`'s version to `2.1.0-1.0.29`
1523

1624
## v1.3.2 / 2024-06-18
1725

gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.3.2
1+
VERSION=1.4.0
22
GROUP=com.ctrip.kotlin
33

44
#Maven Publish Information
@@ -27,4 +27,5 @@ kotlin.code.style=official
2727
kotlin.mpp.stability.nowarn=true
2828
kotlin.mpp.enableCInteropCommonization=true
2929
kotlin.natvie.increment=true
30+
#ksp.useKSP2=true
3031
#kotlin.compiler.execution.strategy=out-of-process

gradle/libs.versions.toml

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[versions]
22

3-
kotlin = "1.9.24"
4-
agp = "8.2.2"
5-
ksp = "1.9.24-1.0.20"
6-
serialization = "1.6.3"
7-
coroutines = "1.8.1"
8-
androidx-annotation = "1.8.0"
3+
kotlin = "2.1.0"
4+
agp = "8.7.3"
5+
ksp = "2.1.0-1.0.29"
6+
serialization = "1.7.3"
7+
coroutines = "1.9.0"
8+
androidx-annotation = "1.9.1"
99
androidx-test = "1.6.1"
10-
sqlite-jdbc = "3.46.0.0"
10+
androidx-test-runner = "1.6.2"
11+
sqlite-jdbc = "3.47.1.0"
1112

1213
[libraries]
1314

@@ -18,13 +19,11 @@ kotlinx-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutin
1819

1920
androidx-annotation = { group = "androidx.annotation", name = "annotation", version.ref = "androidx-annotation" }
2021
androidx-test-core = { group = "androidx.test", name = "core", version.ref = "androidx-test" }
21-
androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidx-test" }
22+
androidx-test-runner = { group = "androidx.test", name = "runner", version.ref = "androidx-test-runner" }
2223
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidx-test" }
2324

2425
sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }
2526

26-
27-
2827
[plugins]
2928

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

sample/build.gradle.kts

+12-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
23

34
plugins {
45
alias(libs.plugins.kotlin.multiplatform)
@@ -14,21 +15,21 @@ kotlin {
1415
publishLibraryVariants("release")
1516
}
1617
jvm {
17-
compilations.all {
18-
kotlinOptions {
19-
jvmTarget = "11"
20-
}
21-
}
18+
compilerOptions.jvmTarget.set(JvmTarget.JVM_11)
2219
}
2320
iosX64()
2421
iosArm64()
2522
iosSimulatorArm64()
23+
24+
compilerOptions {
25+
freeCompilerArgs.add("-Xexpect-actual-classes")
26+
}
2627

2728
sourceSets {
2829
all {
2930
languageSettings.optIn("kotlin.RequiresOptIn")
3031
}
31-
val commonMain by getting {
32+
commonMain {
3233
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
3334
dependencies {
3435
implementation(project(":sqllin-dsl"))
@@ -41,29 +42,25 @@ kotlin {
4142

4243
android {
4344
namespace = "com.ctrip.sqllin.sample"
44-
compileSdk = 34
45+
compileSdk = 35
4546
defaultConfig {
4647
minSdk = 23
4748
}
4849
compileOptions {
4950
sourceCompatibility = JavaVersion.VERSION_11
50-
targetCompatibility = JavaVersion.VERSION_17
51+
targetCompatibility = JavaVersion.VERSION_21
5152
}
5253
}
5354

5455
dependencies {
5556
add("kspCommonMainMetadata", project(":sqllin-processor"))
5657
}
5758

58-
afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331
59+
afterEvaluate { // WORKAROUND: both register() and named() fail – https://github.com/gradle/gradle/issues/9331
5960
tasks {
60-
withType<KotlinCompile<*>> {
61+
withType<KotlinCompilationTask<*>> {
6162
if (name != "kspCommonMainKotlinMetadata")
6263
dependsOn("kspCommonMainKotlinMetadata")
6364
}
6465
}
65-
}
66-
67-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
68-
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes")
6966
}

0 commit comments

Comments
 (0)