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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
![badge-platform-android]
![badge-platform-jvm]
![badge-platform-ios]
![badge-platform-linux]
![badge-platform-macos]
![badge-platform-tvos]
![badge-platform-watchos]
![badge-platform-windows]
![badge-support-apple-silicon]
![badge-support-linux-arm]
<!--
![badge-platform-js]
![badge-platform-js-node]
![badge-platform-linux]
![badge-platform-macos]
![badge-platform-wasm]
![badge-platform-windows]
![badge-support-android-native]
![badge-support-js-ir]
![badge-support-linux-arm]
-->

An [SQLDelight][url-sqldelight] driver that uses [SQLite3MultipleCiphers][url-sqlitemc] for
Expand Down
12 changes: 5 additions & 7 deletions build-logic/src/main/kotlin/-KmpConfigurationExtension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,12 @@ fun KmpConfigurationExtension.configureShared(
kotlinJvmTarget = JavaVersion.VERSION_1_8
}

// Just use JVM. Not dealing with native desktop
// b/c it's a shit-show (especially Linux)
// linuxX64()
// macosArm64()
// macosX64()
// mingwX64()

// https://github.com/touchlab/SQLiter/issues/117
// androidNativeAll()
iosAll()
linuxAll()
macosAll()
mingwAll()
tvosAll()
watchosAll()

Expand Down
13 changes: 13 additions & 0 deletions library/android-unit-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,16 @@ tasks.withType<KotlinCompile> {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}

tasks.getByName("clean") {
doLast {
projectDir
.resolve("src")
.resolve("main")
.resolve("resources")
.resolve("org")
.resolve("sqlite")
.resolve("native")
.deleteRecursively()
}
}
2 changes: 1 addition & 1 deletion library/driver-test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ kmpConfiguration {
}

kotlin {
extensions.configure<SqlDelightExtension>("sqldelight") {
project.extensions.configure<SqlDelightExtension>("sqldelight") {
linkSqlite.set(false)

targets.filterIsInstance<KotlinNativeTarget>()
Expand Down
41 changes: 26 additions & 15 deletions library/driver/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ kmpConfiguration {
val kt = KonanTarget.predefinedTargets[target]!!

// Add as dependency so any kotlin native tooling is downloaded
// before the CompileToBitcode gets executed.
// before the CompileToBitcode task is executed.
cinteropTaskInfo.forEach { (taskName, target) ->
if (target != kt) return@forEach
this.dependsOn(taskName)
Expand All @@ -158,20 +158,20 @@ kmpConfiguration {
}?.let { compilerArgs.addAll(it) }

// Warning/Error suppression flags
listOf(
"-Wno-missing-braces",
"-Wno-missing-field-initializers",
"-Wno-sign-compare",
"-Wno-unused-command-line-argument",
"-Wno-unused-function",
"-Wno-unused-parameter",
"-Wno-unused-variable",
).let { compilerArgs.addAll(it) }

if (kt.family.isAppleFamily) {
// disable warning about gethostuuid being deprecated on darwin
compilerArgs.add("-Wno-#warnings")
}
buildList {
add("-Wno-sign-compare")
add("-Wno-unused-function")
add("-Wno-unused-parameter")
add("-Wno-unused-variable")

if (kt.family.isAppleFamily) {
add("-Wno-missing-braces")
add("-Wno-missing-field-initializers")
add("-Wno-unused-command-line-argument")
// disable warning about gethostuuid being deprecated on darwin
add("-Wno-#warnings")
}
}.let { compilerArgs.addAll(it) }

// SQLITE flags
when (kt.family) {
Expand Down Expand Up @@ -258,6 +258,16 @@ kmpConfiguration {
}
}

tasks.getByName("clean") {
doLast {
projectDir
.resolve("src")
.resolve("androidMain")
.resolve("jniLibs")
.deleteRecursively()
}
}

/**
* Repack dependency jar files.
*
Expand Down Expand Up @@ -331,6 +341,7 @@ private class JdbcRepack {
// Only want the jar file and not xerial/sqlite-jdbc dependency
// b/c we're using a custom build which uses SQLite3MultipleCiphers
private val repackSQLDelightDriver by lazy {
@Suppress("RemoveRedundantCallsOfConversionMethods")
val jarFile = configJDBCRepack.files.first { file ->
file.absolutePath.contains(depSQLDelightDriver.group.toString())
&& file.name == depSQLDelightDriver.toJarFileName()
Expand Down
16 changes: 1 addition & 15 deletions library/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,8 @@ buildConfig {
}

tasks.named<Test>("test") {
project(":library:driver")
.tasks
.names
.forEach {
when (it) {
"publishJvmPublicationToInstallLocallyRepository",
"publishKotlinMultiplatformPublicationToInstallLocallyRepository",
"publishIosX64PublicationToInstallLocallyRepository",
"publishWatchosArm64PublicationToInstallLocallyRepository",
"publishWatchosSimulatorArm64PublicationToInstallLocallyRepository",
-> dependsOn(":library:driver:$it")
else -> {}
}
}

dependsOn(
":library:driver:publishAllPublicationsToInstallLocallyRepository",
":library:android-unit-test:publishAllPublicationsToInstallLocallyRepository",
":library:gradle-plugin:publishAllPublicationsToInstallLocallyRepository",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
**/
import org.jetbrains.kotlin.konan.target.HostManager

plugins {
alias(libs.plugins.kotlin.multiplatform) apply(false)
alias(libs.plugins.sqlitemc)
Expand All @@ -25,10 +23,12 @@ kmpConfiguration {
configure {
jvm()

if (HostManager.hostIsMac) {
iosX64()
watchosSimulatorArm64()
}
iosAll()
linuxAll()
macosAll()
mingwAll()
tvosAll()
watchosAll()

kotlin {
sqliteMC {
Expand Down
10 changes: 8 additions & 2 deletions library/gradle-plugin/src/test/kotlin-mpp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ kmpConfiguration {
configure {
jvm()

linuxAll()
mingwAll()

// Local publications will not be present unless the host is macOS
if (HostManager.hostIsMac) {
iosX64()
watchosArm64()
iosAll()
macosAll()
tvosAll()
watchosAll()
}

kotlin {
Expand Down