Skip to content

Commit 1fb031b

Browse files
authored
Update dokka to 2.0.0 (#10)
1 parent e4cf786 commit 1fb031b

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

build-logic/src/main/kotlin/dokka.gradle.kts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,39 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
**/
16-
import org.jetbrains.dokka.DokkaConfiguration.Visibility
17-
import org.jetbrains.dokka.gradle.DokkaTaskPartial
16+
import org.jetbrains.dokka.gradle.DokkaExtension
17+
import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier
1818
import java.net.URI
19+
import java.time.LocalDate
1920

2021
plugins {
2122
id("org.jetbrains.dokka")
2223
}
2324

24-
// TODO: Update to Dokka 2.0.0+ (Issue #9)
25-
tasks.withType<DokkaTaskPartial>().configureEach {
26-
suppressInheritedMembers = true
25+
rootProject.dependencies { dokka(project(project.path)) }
26+
27+
extensions.configure<DokkaExtension> {
28+
dokkaPublications.configureEach {
29+
suppressInheritedMembers.set(true)
30+
}
2731

2832
dokkaSourceSets.configureEach {
2933
includes.from("README.md")
30-
noStdlibLink = true
34+
enableKotlinStdLibDocumentationLink.set(false)
3135

3236
sourceLink {
33-
localDirectory = rootDir
34-
remoteUrl = URI("https://github.com/KotlinCrypto/error/tree/master").toURL()
35-
remoteLineSuffix = "#L"
37+
localDirectory.set(rootDir)
38+
remoteUrl.set(URI("https://github.com/KotlinCrypto/error/tree/master"))
39+
remoteLineSuffix.set("#L")
3640
}
3741

38-
documentedVisibilities.set(setOf(
39-
Visibility.PUBLIC,
40-
Visibility.PROTECTED,
41-
))
42+
documentedVisibilities(
43+
VisibilityModifier.Public,
44+
VisibilityModifier.Protected,
45+
)
46+
}
47+
48+
pluginsConfiguration.html {
49+
footerMessage.set("© 2025-${LocalDate.now().year} Copyright KotlinCrypto")
4250
}
4351
}

build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ plugins {
2424
}
2525

2626
allprojects {
27-
findProperty("GROUP")?.let { group = it }
27+
// https://github.com/Kotlin/dokka/issues/4030#issuecomment-2669254887
28+
if (this.project == this.rootProject) {
29+
group = "root"
30+
} else {
31+
findProperty("GROUP")?.let { group = it }
32+
}
33+
2834
findProperty("VERSION_NAME")?.let { version = it }
2935
findProperty("POM_DESCRIPTION")?.let { description = it.toString() }
3036

gh-pages/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ echo "$REPO_NAME.kotlincrypto.org" > "$DIR_SCRIPT/$REPO_NAME/CNAME"
2626

2727
cd ..
2828
./gradlew clean -DKMP_TARGETS_ALL
29-
./gradlew dokkaHtmlMultiModule --no-build-cache -DKMP_TARGETS_ALL
30-
cp -aR build/dokka/htmlMultiModule/* gh-pages/$REPO_NAME
29+
./gradlew dokkaGenerate --no-build-cache -DKMP_TARGETS_ALL
30+
cp -aR build/dokka/html/* gh-pages/$REPO_NAME
3131

3232
cd "$DIR_SCRIPT/$REPO_NAME"
3333
sed -i "s|module:|module:library/|g" "package-list"

gradle.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ kotlin.mpp.applyDefaultHierarchyTemplate=false
1010
kotlin.mpp.stability.nowarn=true
1111
kotlin.native.ignoreDisabledTargets=true
1212

13+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
14+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
15+
1316
SONATYPE_HOST=S01
1417
RELEASE_SIGNING_ENABLED=true
1518

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
gradle-binary-compat = "0.17.0"
3-
gradle-dokka = "1.9.20"
3+
gradle-dokka = "2.0.0"
44
gradle-kmp-configuration = "0.4.0"
55
gradle-kotlin = "2.1.10"
66
gradle-publish-maven = "0.30.0"

0 commit comments

Comments
 (0)