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

Add linuxArm64, androidNative and watchosDeviceArm targets to runtime #4258

Merged
merged 2 commits into from
Jun 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MultiplatformConventions : Plugin<Project> {
iosX64()

// tier 2
// linuxArm64()
linuxArm64()
watchosSimulatorArm64()
watchosX64()
watchosArm32()
Expand All @@ -49,12 +49,12 @@ class MultiplatformConventions : Plugin<Project> {
iosArm64()

// tier 3
// androidNativeArm32()
// androidNativeArm64()
// androidNativeX86()
// androidNativeX64()
androidNativeArm32()
androidNativeArm64()
androidNativeX86()
androidNativeX64()
mingwX64()
// watchosDeviceArm64()
watchosDeviceArm64()

// linking fails for the linux test build if not built on a linux host
// ensure the tests and linking for them is only done on linux hosts
Expand Down
24 changes: 23 additions & 1 deletion drivers/driver-test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("app.cash.sqldelight.multiplatform")
alias(libs.plugins.kotlin.multiplatform)
id("app.cash.sqldelight.toolchain.runtime")
}

Expand All @@ -9,6 +9,28 @@ sourceSets {
}

kotlin {
jvm()

js {
browser()
}

// same targets as in `native-driver`
iosX64()
iosArm64()
tvosX64()
tvosArm64()
watchosX64()
watchosArm32()
watchosArm64()
macosX64()
mingwX64()
linuxX64()
macosArm64()
iosSimulatorArm64()
watchosSimulatorArm64()
tvosSimulatorArm64()

sourceSets {
commonMain {
dependencies {
Expand Down
9 changes: 8 additions & 1 deletion drivers/native-driver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ kotlin {
target.group("native") {
it.group("nativeLinuxLike") {
it.withLinux()
it.withApple()
// no withApple: https://github.com/cashapp/sqldelight/issues/4257
it.withIos()
it.withTvos()
it.withMacos()
it.withWatchosArm32()
it.withWatchosArm64()
it.withWatchosX64()
it.withWatchosSimulatorArm64()
}
}
}
Expand Down
22 changes: 20 additions & 2 deletions extensions/coroutines-extensions/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ plugins {
archivesBaseName = 'sqldelight-coroutines-extensions'

kotlin {
targetHierarchy.default {
it.group("testableNative") {
// no withApple: https://github.com/cashapp/sqldelight/issues/4257
it.withIos()
it.withTvos()
it.withMacos()
it.withWatchosArm32()
it.withWatchosArm64()
it.withWatchosX64()
it.withWatchosSimulatorArm64()

it.withLinuxX64()
it.withMingw()
}
}

sourceSets {
commonMain {
dependencies {
Expand All @@ -21,13 +37,13 @@ kotlin {
implementation libs.kotlin.coroutines.test
implementation libs.kotlin.test
implementation libs.turbine
implementation libs.stately.concurrency
}
}
jvmTest {
dependencies {
implementation libs.kotlin.test.junit
implementation projects.drivers.sqliteDriver
implementation libs.stately.concurrency
}
languageSettings {
optIn('kotlinx.coroutines.ExperimentalCoroutinesApi')
Expand All @@ -36,11 +52,13 @@ kotlin {
jsTest {
dependencies {
implementation projects.drivers.sqljsDriver
implementation libs.stately.concurrency
}
}
nativeTest {
testableNativeTest {
dependencies {
implementation projects.drivers.nativeDriver
implementation libs.stately.concurrency
}
}
}
Expand Down
18 changes: 17 additions & 1 deletion runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ apiValidation {
}

kotlin {
targetHierarchy.default {
it.group("testableNative") {
// no withApple: https://github.com/cashapp/sqldelight/issues/4257
it.withIos()
it.withTvos()
it.withMacos()
it.withWatchosArm32()
it.withWatchosArm64()
it.withWatchosX64()
it.withWatchosSimulatorArm64()

it.withLinuxX64()
it.withMingw()
}
}

sourceSets {
commonMain {
}
Expand All @@ -30,7 +46,7 @@ kotlin {
implementation libs.stately.collections
}
}
nativeTest {
testableNativeTest {
dependencies {
implementation libs.stately.concurrency
implementation libs.stately.collections
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.squareup.sqldelight.internal

// https://github.com/cashapp/sqldelight/issues/4257
// this code isn't used but need for compiling
actual fun <T> copyOnWriteList(): MutableList<T> = mutableListOf()
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.squareup.sqldelight.logs

// https://github.com/cashapp/sqldelight/issues/4257
// this code isn't used but need for compiling
actual class LinkedList<T>
actual constructor(objectPoolSize: Int) {
private val list = mutableListOf<T>()
actual fun add(element: T) = list.add(element)

actual fun clear() {
list.clear()
}

actual operator fun get(index: Int) = list[index]
}