-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
56 lines (47 loc) · 1.46 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
54
55
56
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockMismatchReport
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlugin
import org.jetbrains.kotlin.gradle.targets.js.yarn.YarnRootExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("multiplatform")
id("targets")
id("cinterop")
id("publish")
id("com.goncalossilva.resources") version "0.4.0"
}
repositories {
mavenCentral()
}
kotlin {
jvmToolchain(11)
explicitApi()
sourceSets {
all {
languageSettings.optIn("kotlinx.cinterop.ExperimentalForeignApi")
}
@Suppress("UNUSED_VARIABLE")
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation("com.goncalossilva:resources:0.4.0")
}
}
}
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}
rootProject.plugins.withType(YarnPlugin::class.java) {
rootProject.configure<YarnRootExtension> {
yarnLockMismatchReport = YarnLockMismatchReport.WARNING
yarnLockAutoReplace = true
}
}
// Sanity check before attempting to publish root target without having all targets enabled.
tasks.matching { it.name.startsWith("publishKotlinMultiplatform") }.configureEach {
doFirst {
require(findProperty("targets") == "all") {
"Configuration is set to publish root target without all targets enabled."
}
}
}