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

kotlin 1.7.0 #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 @@ -54,7 +54,14 @@ data class SoInput(
}
}
Family.MINGW -> "windows_${konanTarget.architecture.bitness}"
Family.OSX -> "osx_${konanTarget.architecture.bitness}"
Family.OSX -> {
when (konanTarget.architecture){
Architecture.ARM64 ->"osx_arm64"
Architecture.X64 -> "osx_64"
else -> error("Unsupported architecture for mac: ${konanTarget.architecture}")
}

}
Family.ANDROID -> when (konanTarget.architecture) {
Architecture.X86 -> "x86"
Architecture.X64 -> "x86_64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,5 +227,5 @@ internal object SqliteCompilation {
}
}

private const val BASE_URL = "https://www.sqlite.org/2020/sqlite-amalgamation-"
private const val BASE_URL = "https://www.sqlite.org/2022/sqlite-amalgamation-"
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ kotlin.mpp.stability.nowarn=true
# We can use this only in non windows platforms because jint type changes. This is also we don't
# build anything but windows on windows.
kotlin.mpp.enableCInteropCommonization=true
kotlin.native.binary.memoryModel=experimental
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
androidGradlePlugin="7.2.0"
spotless="6.0.5"
ktlint="10.2.0"
kotlin="1.6.21"
kotlin="1.7.0"

[libraries]
androidGradlePlugin = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin"}
nativeLibLoader = { module = "org.scijava:native-lib-loader", version = "2.3.4" }
nativeLibLoader = { module = "org.scijava:native-lib-loader", version = "2.4.0" }
kotlinPoet = { module = "com.squareup:kotlinpoet", version = "1.5.0" }
androidxTestJunit = { module = "androidx.test.ext:junit", version = "1.1.1" }
androidxTestRunner = { module = "androidx.test:runner", version = "1.2.0" }
Expand Down
21 changes: 9 additions & 12 deletions sqlitebindings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ ksqliteBuild {
android()
includeSqlite(
SqliteCompilationConfig(
version = "3.31.1"
version = "3.38.5"
)
)
publish()
Expand All @@ -53,35 +53,30 @@ ksqliteBuild {

kotlin {

val combinedSharedLibsFolder = project.layout.buildDirectory.dir("combinedSharedLibs")
val combineSharedLibsTask =
com.birbit.ksqlite.build.CollectNativeLibrariesTask
.create(
project = project,
namePrefix = "sqlite3jni",
outFolder = combinedSharedLibsFolder,
outFolder = project.layout.buildDirectory.dir("combinedSharedLibs"),
forAndroid = false
)

val combinedAndroidSharedLibsFolder = project.layout.buildDirectory.dir("combinedAndroidSharedLibs")
val combineAndroidSharedLibsTask =
com.birbit.ksqlite.build.CollectNativeLibrariesTask
.create(
project = project,
namePrefix = "sqlite3jni",
outFolder = combinedAndroidSharedLibsFolder,
outFolder = project.layout.buildDirectory.dir("combinedAndroidSharedLibs"),
forAndroid = true
)
project.android.sourceSets {
this["main"].jniLibs {
srcDir(combinedAndroidSharedLibsFolder)
srcDir(combineAndroidSharedLibsTask.map {
it.outputDir
})
}
}
val androidExt = project.extensions.findByType(com.android.build.gradle.LibraryExtension::class)
androidExt!!.libraryVariants.all {
this.javaCompileProvider.dependsOn(combineAndroidSharedLibsTask)
}
jvm().compilations["main"].compileKotlinTask.dependsOn(combineSharedLibsTask)
sourceSets {
val commonMain by getting {
dependencies {
Expand Down Expand Up @@ -135,7 +130,9 @@ kotlin {
dependencies {
implementation(libs.nativeLibLoader)
}
resources.srcDir(combinedSharedLibsFolder)
resources.srcDir(combineSharedLibsTask.map {
it.outputDir
})
}
// JVM-specific tests and their dependencies:
jvm().compilations["test"].defaultSourceSet {
Expand Down
5 changes: 4 additions & 1 deletion sqlitebindings/src/nativeInterop/cinterop/sqlite.def
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ staticLibraries=libsqlite3.a
#libraryPaths=sqlite
#libraryPaths = /home/yboyar/src/kotlin-jni-test/build/sqlite-compilation/output/linuxX64
linkerOpts.linux_x64 = -lpthread -ldl
linkerOpts.macos_x64 = -lpthread -ldl
linkerOpts.macos_x64 = -lpthread -ldl
# TODO we may want to copy all opts from sqlite compilation to here for consistency.
# after all, cintrop looks into this file, not how we compile sqlite.
compilerOpts = -DSQLITE_ENABLE_NORMALIZE=1