Skip to content
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
67 changes: 18 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
run: ./gradlew :sqllin-driver:assemble -PonCICD

- name: Run sqllin-driver macOS Arm64 Tests
run: ./gradlew :sqllin-driver-test:cleanMacosArm64Test :sqllin-driver-test:macosArm64Test --stacktrace
run: ./gradlew :sqllin-driver:cleanMacosArm64Test :sqllin-driver:macosArm64Test --stacktrace

- name: Run sqllin-driver JVM Unit Tests on macOS Arm64
run: ./gradlew :sqllin-driver-test:cleanJvmTest :sqllin-driver-test:jvmTest --stacktrace
run: ./gradlew :sqllin-driver:cleanJvmTest :sqllin-driver:jvmTest --stacktrace

- name: Build sqllin-dsl
run: ./gradlew :sqllin-dsl:assemble -PonCICD
Expand Down Expand Up @@ -164,10 +164,10 @@ jobs:
run: ./gradlew :sqllin-driver:linuxX64MainKlibrary :sqllin-driver:jvmJar

- name: Run sqllin-driver Linux X64 Tests
run: ./gradlew :sqllin-driver-test:cleanLinuxX64Test :sqllin-driver-test:linuxX64Test --stacktrace
run: ./gradlew :sqllin-driver:cleanLinuxX64Test :sqllin-driver:linuxX64Test --stacktrace

- name: Run sqllin-driver JVM Unit Tests on Linux X64
run: ./gradlew :sqllin-driver-test:cleanJvmTest :sqllin-driver-test:jvmTest --stacktrace
run: ./gradlew :sqllin-driver:cleanJvmTest :sqllin-driver:jvmTest --stacktrace

- name: Build sqllin-processor
run: ./gradlew :sqllin-processor:assemble
Expand Down Expand Up @@ -198,15 +198,6 @@ jobs:
build-android-and-test:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
include:
- api-level: 26
target: default
device: pixel_2
- api-level: 36
target: google_apis
device: pixel_6

steps:
- name: Checkout
Expand All @@ -227,52 +218,30 @@ jobs:
- name: Build Android
run: ./gradlew :sqllin-driver:assembleAndroidMain :sqllin-dsl:assembleAndroidMain

- name: AVD Cache
- name: Cache Robolectric Android-All Jars
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: Create AVD and Generate Snapshot for Caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: ${{ matrix.device }}
emulator-build: 15368433
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching."

- name: Run Android Instrumented Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: x86_64
profile: ${{ matrix.device }}
emulator-build: 15368433
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :sqllin-driver-test:connectedAndroidDeviceTest --stacktrace & ./gradlew :sqllin-dsl-test:connectedAndroidDeviceTest --stacktrace
path: ~/.m2/repository/org/robolectric
key: ${{ runner.os }}-robolectric-${{ hashFiles('gradle/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-robolectric-

- name: Run sqllin-driver Android Unit Tests
run: ./gradlew :sqllin-driver:testAndroidHostTest --stacktrace

- name: Run sqllin-dsl Android Unit Tests
run: ./gradlew :sqllin-dsl-test:testAndroidHostTest --stacktrace

- name: Upload sqllin-driver Reports
uses: actions/upload-artifact@v4
with:
name: Test-Reports-Android-driver-API${{ matrix.api-level }}
name: Test-Reports-Android-driver
path: sqllin-driver/build/reports
if: failure()

- name: Upload sqllin-dsl Reports
uses: actions/upload-artifact@v4
with:
name: Test-Reports-Android-dsl-API${{ matrix.api-level }}
path: sqllin-dsl/build/reports
name: Test-Reports-Android-dsl
path: sqllin-dsl-test/build/reports
if: failure()
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ local.properties
/sqllin-driver/build
/sqllin-dsl/build
/sqllin-processor/build
/sqllin-driver-test/build
/sqllin-dsl-test/build
/sample/build
*.podspec
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

- Date format: YYYY-MM-dd

## 2.4.0 / 2026-xx-xx

### All

* Update `Kotlin`'s version to `2.4.20`
* Update `AGP`'s version to `9.4.0`
* Migrate the Android instrumented tests to `Robolectric`, they now run on the JVM as host unit tests against `API 26` and `API 37`, and no longer need an emulator
* Move the `sqllin-driver` tests back into the `sqllin-driver` module's `commonTest`, and remove the `sqllin-driver-test` module

### sqllin-driver

* Update `sqlite-jdbc`'s version to `3.53.4.0`

## 2.3.0 / 2026-08-20

### All
Expand Down
13 changes: 13 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b96cc4b9c59b5bff244af296e50d5ea3/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fdfa2f9fadcf75fb9616fde209d60b55/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b96cc4b9c59b5bff244af296e50d5ea3/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fdfa2f9fadcf75fb9616fde209d60b55/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97b61e8788c7490a5f53d8951b11ea7a/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/feb8af2956f2e263086e0a8f9a1df390/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/b96cc4b9c59b5bff244af296e50d5ea3/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fdfa2f9fadcf75fb9616fde209d60b55/redirect
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/eff42deed1d8947129a4e66cd07a89f4/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8fe418192094ee8db0da620bcb6b1629/redirect
toolchainVendor=JETBRAINS
toolchainVersion=25
13 changes: 7 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[versions]

kotlin = "2.4.10"
agp = "9.3.1"
kotlin = "2.4.20"
agp = "9.4.0"
ksp = "2.3.11"
serialization = "1.11.0"
coroutines = "1.11.0"
androidx-annotation = "1.10.0"
androidx-test = "1.7.0"
androidx-test-runner = "1.7.0"
sqlite-jdbc = "3.53.2.1"
robolectric = "4.17"
junit = "4.13.2"
sqlite-jdbc = "3.53.4.0"
jvm-toolchain = "21"
android-sdk-compile = "37"
android-sdk-min = "24"
Expand All @@ -24,8 +25,8 @@ kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor

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-runner" }
androidx-test-rules = { group = "androidx.test", name = "rules", version.ref = "androidx-test" }
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }
junit = { group = "junit", name = "junit", version.ref = "junit" }

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

Expand Down
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include(":sqllin-driver")
include(":sqllin-dsl")
include(":sqllin-processor")
include(":sqllin-dsl-test")
include(":sqllin-driver-test")
include(":sample")

pluginManagement {
Expand All @@ -13,6 +12,9 @@ pluginManagement {
mavenCentral()
}
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}

dependencyResolutionManagement {
@Suppress("UnstableApiUsage")
Expand Down
100 changes: 0 additions & 100 deletions sqllin-driver-test/build.gradle.kts

This file was deleted.

37 changes: 28 additions & 9 deletions sqllin-driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ plugins {
alias(libs.plugins.vanniktech.maven.publish)
}

val GROUP_ID: String by project
val VERSION: String by project
val GROUP_ID = project.property("GROUP_ID") as String
val VERSION = project.property("VERSION") as String

group = GROUP_ID
version = VERSION
Expand All @@ -21,6 +21,9 @@ kotlin {
namespace = "com.ctrip.sqllin.driver"
compileSdk = libs.versions.android.sdk.compile.get().toInt()
minSdk = libs.versions.android.sdk.min.get().toInt()
withHostTest {
isIncludeAndroidResources = true
}
}

jvm {
Expand Down Expand Up @@ -59,15 +62,31 @@ kotlin {
optIn("kotlin.RequiresOptIn")
}
}
commonTest.dependencies {
implementation(kotlin("test"))
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.test)
}
androidMain.dependencies {
implementation(libs.androidx.annotation)
}
getByName("androidHostTest").dependencies {
implementation(libs.junit)
implementation(libs.androidx.test.core)
implementation(libs.robolectric)
}
jvmMain.dependencies {
implementation(libs.sqlite.jdbc)
}
}
}

// Robolectric reflects into JDK internals when setting up newer Android SDKs,
// which the module system blocks by default since JDK 17.
tasks.withType<Test>().matching { it.name == "testAndroidHostTest" }.configureEach {
jvmArgs("--add-exports=java.base/jdk.internal.access=ALL-UNNAMED")
}

gradle.taskGraph.whenReady {
if (!project.hasProperty("onCICD"))
return@whenReady
Expand Down Expand Up @@ -111,29 +130,29 @@ mavenPublishing {
pom {
name.set(artifactId)
description.set("Low-level API for SQLite on Kotlin Multiplatform")
val githubURL: String by project
val githubURL = project.property("githubURL") as String
url.set(githubURL)
licenses {
license {
val licenseName: String by project
val licenseName = project.property("licenseName") as String
name.set(licenseName)
val licenseURL: String by project
val licenseURL = project.property("licenseURL") as String
url.set(licenseURL)
}
}
developers {
developer {
val developerID: String by project
val developerID = project.property("developerID") as String
id.set(developerID)
val developerName: String by project
val developerName = project.property("developerName") as String
name.set(developerName)
val developerEmail: String by project
val developerEmail = project.property("developerEmail") as String
email.set(developerEmail)
}
}
scm {
url.set(githubURL)
val scmURL: String by project
val scmURL = project.property("scmURL") as String
connection.set(scmURL)
developerConnection.set(scmURL)
}
Expand Down
Loading
Loading