Skip to content

Commit 601e5f1

Browse files
authored
Move samples and packages configuration of Dokka to convention plugin (#321)
Fixes #210
1 parent 05abd45 commit 601e5f1

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

build-logic/src/main/kotlin/kotlinx/io/conventions/kotlinx-io-dokka.gradle.kts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,18 @@ tasks.withType<DokkaTaskPartial>().configureEach {
1919
remoteUrl.set(URL("https://github.com/kotlin/kotlinx-io/tree/master"))
2020
remoteLineSuffix.set("#L")
2121
}
22+
23+
// we don't want to advertise `unsafe` APIs in documentation
24+
perPackageOption {
25+
suppress.set(true)
26+
matchingRegex.set(".*unsafe.*")
27+
}
28+
29+
// as in kotlinx-io-multiplatform.gradle.kts:configureSourceSet
30+
val platform = name.dropLast(4)
31+
samples.from(
32+
"common/test/samples",
33+
"$platform/test/samples"
34+
)
2235
}
2336
}

bytestring/build.gradle.kts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import org.jetbrains.dokka.gradle.DokkaTaskPartial
2-
31
plugins {
42
id("kotlinx-io-multiplatform")
53
id("kotlinx-io-publish")
@@ -26,15 +24,3 @@ kotlin {
2624
}
2725
}
2826
}
29-
30-
31-
tasks.withType<DokkaTaskPartial>().configureEach {
32-
dokkaSourceSets.configureEach {
33-
perPackageOption {
34-
suppress.set(true)
35-
matchingRegex.set(".*unsafe.*")
36-
}
37-
38-
samples.from("common/test/samples/samples.kt")
39-
}
40-
}

core/build.gradle.kts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import org.gradle.internal.os.OperatingSystem
7-
import org.jetbrains.dokka.gradle.DokkaTaskPartial
87

98
plugins {
109
id("kotlinx-io-multiplatform")
@@ -53,20 +52,6 @@ kotlin {
5352
}
5453
}
5554

56-
tasks.withType<DokkaTaskPartial>().configureEach {
57-
dokkaSourceSets.configureEach {
58-
samples.from(
59-
"common/test/samples/rawSinkSample.kt",
60-
"common/test/samples/rawSourceSample.kt",
61-
"common/test/samples/moduleDescriptionSample.kt",
62-
"common/test/samples/samples.kt",
63-
"common/test/samples/byteStringSample.kt",
64-
"jvm/test/samples/samplesJvm.kt",
65-
"apple/test/samples/samplesApple.kt"
66-
)
67-
}
68-
}
69-
7055
tasks.named("wasmWasiNodeTest") {
7156
// TODO: remove once https://youtrack.jetbrains.com/issue/KT-65179 solved
7257
doFirst {

0 commit comments

Comments
 (0)