-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
93 lines (79 loc) · 2.33 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
93 lines (79 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import org.jetbrains.kotlin.konan.target.HostManager
plugins {
kotlin("multiplatform")
id("com.vanniktech.maven.publish") version "0.34.0"
}
val GROUP: String by project
val VERSION_NAME: String by project
group = GROUP
version = VERSION_NAME
kotlin {
jvmToolchain(17)
}
kotlin {
applyDefaultHierarchyTemplate()
val knTargets = listOf(
macosX64(),
iosX64(),
iosArm64(),
watchosArm32(),
watchosArm64(),
watchosX64(),
tvosArm64(),
tvosX64(),
macosArm64(),
iosSimulatorArm64(),
watchosSimulatorArm64(),
tvosSimulatorArm64(),
watchosDeviceArm64(),
mingwX64(),
linuxX64(),
linuxArm64(),
)
knTargets.forEach { target ->
target.compilations["main"].cinterops.create("sqlite3").apply {
includeDirs("$projectDir/src/include")
// extraOpts = listOf("-mode", "sourcecode")
}
target.compilerOptions {
freeCompilerArgs.addAll(
when {
HostManager.hostIsLinux -> listOf(
"-linker-options",
"-lsqlite3 -L/usr/lib/x86_64-linux-gnu -L/usr/lib"
)
HostManager.hostIsMingw -> listOf("-linker-options", "-lsqlite3 -Lc:\\msys64\\mingw64\\lib")
else -> listOf("-linker-options", "-lsqlite3")
}
)
}
}
sourceSets {
all {
languageSettings {
optIn("kotlin.experimental.ExperimentalNativeApi")
optIn("kotlinx.cinterop.ExperimentalForeignApi")
optIn("kotlinx.cinterop.BetaInteropApi")
compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
}
commonTest.dependencies {
implementation(kotlin("test"))
}
}
}
mavenPublishing {
// Signing and POM are automatically handled by the plugin + gradle.properties
configureBasedOnAppliedPlugins(true, true)
publishToMavenCentral(automaticRelease = true)
}
listOf(
"linuxX64Test",
"linuxArm64Test",
"linkDebugTestLinuxX64",
"linkDebugTestLinuxArm64",
"mingwX64Test",
"linkDebugTestMingwX64",
).forEach { tasks.findByName(it)?.enabled = false }