Skip to content

Commit b677635

Browse files
authored
Add Dokka support (#231)
Fixes #192
1 parent 8b5a5ca commit b677635

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

core/build.gradle.kts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import java.util.Locale
55
import javax.xml.parsers.DocumentBuilderFactory
66
import java.io.ByteArrayOutputStream
77
import java.io.PrintWriter
8+
import org.jetbrains.dokka.gradle.AbstractDokkaLeafTask
89

910
plugins {
1011
kotlin("multiplatform")
1112
kotlin("plugin.serialization")
13+
id("org.jetbrains.dokka")
1214
`maven-publish`
1315
}
1416

@@ -343,3 +345,15 @@ val downloadWindowsZonesMapping by tasks.registering {
343345
}
344346
}
345347
}
348+
349+
tasks.withType<AbstractDokkaLeafTask>().configureEach {
350+
dokkaSourceSets.configureEach {
351+
// reportUndocumented.set(true) // much noisy output about `hashCode` and serializer encoders, decoders etc
352+
skipDeprecated.set(true)
353+
// hide the `internal` package, which, on JS, has public members generated by Dukat that would get mentioned
354+
perPackageOption {
355+
matchingRegex.set(".*\\.internal\\..*")
356+
suppress.set(true)
357+
}
358+
}
359+
}

core/common/src/Exceptions.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55

66
package kotlinx.datetime
77

8+
/**
9+
* Thrown by date-time arithmetic operations if the result can not be computed or represented.
10+
*/
811
public class DateTimeArithmeticException: RuntimeException {
912
public constructor(): super()
1013
public constructor(message: String): super(message)
1114
public constructor(cause: Throwable): super(cause)
1215
public constructor(message: String, cause: Throwable): super(message, cause)
1316
}
1417

18+
/**
19+
* Thrown when attempting to construct a [TimeZone] with an invalid ID.
20+
*/
1521
public class IllegalTimeZoneException: IllegalArgumentException {
1622
public constructor(): super()
1723
public constructor(message: String): super(message)

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ version=0.4.0
66
versionSuffix=SNAPSHOT
77

88
kotlinVersion=1.7.0
9+
dokkaVersion=1.7.0
910
serializationVersion=1.3.2
1011

1112
java.mainToolchainVersion=8

settings.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ pluginManagement {
55
gradlePluginPortal()
66
}
77
val kotlinVersion: String by settings
8+
val dokkaVersion: String by settings
89
plugins {
910
kotlin("multiplatform") version kotlinVersion
1011
kotlin("plugin.serialization") version kotlinVersion
12+
id("org.jetbrains.dokka") version dokkaVersion
1113
}
1214
}
1315

0 commit comments

Comments
 (0)