-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
61 lines (56 loc) · 2.42 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
61 lines (56 loc) · 2.42 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
import org.jetbrains.kotlin.gradle.targets.wasm.yarn.WasmYarnPlugin
import org.jetbrains.kotlin.gradle.targets.wasm.yarn.WasmYarnRootExtension
plugins {
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.composeMultiplatform) apply false
alias(libs.plugins.composeCompiler) apply false
alias(libs.plugins.vanniktech.mavenPublish) apply false
alias(libs.plugins.spotless) apply false
alias(libs.plugins.detekt) apply false
alias(libs.plugins.bcv) apply false
// Applied at the root so docs and coverage can aggregate across the published modules.
alias(libs.plugins.dokka)
alias(libs.plugins.kover)
}
// ---------------------------------------------------------------------------
// Aggregate API docs (Dokka) and coverage (Kover) across the published library
// modules. The ≥80% coverage gate is enforced on the merged report so that
// thinly-unit-tested transport modules don't each need to clear the bar alone.
// ---------------------------------------------------------------------------
val publishedLibraryModules = listOf(":core", ":transport-tcp", ":transport-ws")
dependencies {
publishedLibraryModules.forEach {
dokka(project(it))
kover(project(it))
}
}
kover {
reports {
total {
xml {
onCheck = false
}
}
verify {
rule {
minBound(80)
}
}
}
}
// ---------------------------------------------------------------------------
// Security: pin the transitive npm `ws` dependency to a patched version.
// The wasmJs target's JS dev/test toolchain (webpack-dev-server / karma) pulls
// in `ws`, which Kotlin otherwise resolves to a vulnerable version:
// - uninitialized-memory disclosure (GHSA-58qx-3vcg-4xpx; fixed in 8.20.1)
// - memory-exhaustion DoS via tiny fragments (fixed in 8.21.0)
// The wasmJs target uses its own Yarn store (kotlin-js-store/wasm/yarn.lock),
// so the override targets the Wasm Yarn plugin/extension — not the JS one.
// After changing this pin, regenerate the lockfile with:
// ./gradlew kotlinWasmUpgradeYarnLock
// ---------------------------------------------------------------------------
plugins.withType<WasmYarnPlugin> {
the<WasmYarnRootExtension>().resolution("ws", "8.21.0")
}