-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
53 lines (46 loc) · 1.57 KB
/
build.gradle.kts
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
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig
plugins {
alias(libs.plugins.kotlin.multiplatform)
id("convention.publication")
}
group = PublishingInfo.GROUP
version = PublishingInfo.Artifact.VERSION
kotlin {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
explicitApi()
}
jvm()
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
moduleName = PublishingInfo.Artifact.ID
browser {
commonWebpackConfig {
outputFileName = "${PublishingInfo.Artifact.ID}.js"
devServer = (devServer ?: KotlinWebpackConfig.DevServer()).apply {
static = (static ?: mutableListOf()).apply {
// Serve sources to debug inside browser
add(project.projectDir.path)
}
}
}
}
binaries.executable()
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = PublishingInfo.Artifact.NAME
isStatic = true
}
}
//https://kotlinlang.org/docs/native-objc-interop.html#export-of-kdoc-comments-to-generated-objective-c-headers
targets.withType<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget> {
compilations["main"].compilerOptions.options.freeCompilerArgs.add("-Xexport-kdoc")
}
}