-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle.kts
128 lines (110 loc) · 4.28 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import buildsrc.utils.configureGradleDaemonJvm
import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeTest
import org.jetbrains.kotlin.gradle.targets.native.tasks.KotlinNativeSimulatorTest
plugins {
buildsrc.conventions.lang.`kotlin-multiplatform`
buildsrc.conventions.publishing
buildsrc.conventions.`git-branch-publish`
buildsrc.conventions.`yaml-testing`
buildsrc.conventions.`multiplatform-test-resources`
id("dev.adamko.dokkatoo-html") version "2.4.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.17.0"
}
group = "it.krzeminski"
version = "3.1.1-SNAPSHOT"
description = "SnakeYAML Engine KMP"
apiValidation {
ignoredProjects += listOf("snake-kmp-benchmarks")
}
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.squareup.okio:okio:3.10.2")
implementation("net.thauvin.erik.urlencoder:urlencoder-lib:1.6.0")
}
}
commonTest {
kotlin.srcDirs(
tasks.yamlTestSuiteDataSources,
tasks.convertCommonTestResourcesToKotlin,
)
dependencies {
implementation(libs.kotest.framework.engine)
implementation(libs.kotest.framework.api)
implementation(libs.kotest.assertions.core)
implementation("org.jetbrains:annotations:26.0.2")
// Overridig coroutines' version to solve a problem with WASM JS tests.
// See https://kotlinlang.slack.com/archives/CDFP59223/p1736191408326039?thread_ts=1734964013.996149&cid=CDFP59223
// TODO: remove this workaround in https://github.com/krzema12/snakeyaml-engine-kmp/issues/337
runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
}
}
jvmTest {
dependencies {
implementation("org.junit.jupiter:junit-jupiter-engine:5.11.4")
implementation(libs.kotest.runner.junit5)
implementation("com.google.guava:guava:33.4.0-jre")
}
}
}
}
tasks.withType<Test>().configureEach {
environment(
"EnvironmentKey1" to "EnvironmentValue1",
"EnvironmentEmpty" to "",
)
}
tasks.withType<KotlinJsTest>().configureEach {
environment("EnvironmentKey1", "EnvironmentValue1")
environment("EnvironmentEmpty", "")
}
tasks.withType<KotlinNativeTest>().configureEach {
environment("EnvironmentKey1", "EnvironmentValue1")
environment("EnvironmentEmpty", "")
}
tasks.withType<KotlinNativeSimulatorTest>().configureEach {
environment("SIMCTL_CHILD_EnvironmentKey1", "EnvironmentValue1")
environment("SIMCTL_CHILD_EnvironmentEmpty", "")
}
dokkatoo {
moduleName = "SnakeYAML Engine KMP"
val docsDir = layout.projectDirectory.dir("docs")
dokkatooSourceSets.configureEach {
includes.from(docsDir.file("modules.md"))
externalDocumentationLinks.register("okio") {
packageListUrl("https://square.github.io/okio/3.x/okio/okio/package-list")
url("https://square.github.io/okio/3.x/okio/")
}
sourceLink {
localDirectory = layout.projectDirectory
val projectVersion = provider { project.version.toString() }
remoteUrl = projectVersion.map { version ->
// if project version matches SemVer, then point the URL to a tag - otherwise, point to main
val remoteVersion =
if (version.matches(Regex("""[1-9][0-9]*\.[1-9][0-9]*\.[1-9][0-9]*"""))) {
"v${version}"
} else {
"main"
}
uri("https://github.com/krzema12/snakeyaml-engine-kmp/blob/$remoteVersion")
}
}
}
pluginsConfiguration {
html {
homepageLink = "https://github.com/krzema12/snakeyaml-engine-kmp"
customAssets.from(
docsDir.files(
"img/homepage.svg",
)
)
}
}
}
configureGradleDaemonJvm(
project = project,
updateDaemonJvm = tasks.updateDaemonJvm,
gradleDaemonJvmVersion = provider { JavaVersion.toVersion(21) },
)