Skip to content

Commit bd911c4

Browse files
authored
Update dokka to 2.0.0 (#125)
1 parent 816bb91 commit bd911c4

File tree

6 files changed

+39
-22
lines changed

6 files changed

+39
-22
lines changed

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

+25-15
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,45 @@
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 #121)
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

32-
externalDocumentationLink {
33-
url = URI("https://error.kotlincrypto.org/").toURL()
36+
externalDocumentationLinks {
37+
register(project.path + ":error") {
38+
url.set(URI("https://error.kotlincrypto.org/"))
39+
}
3440
}
3541

3642
sourceLink {
37-
localDirectory = rootDir
38-
remoteUrl = URI("https://github.com/KotlinCrypto/core/tree/master").toURL()
39-
remoteLineSuffix = "#L"
43+
localDirectory.set(rootDir)
44+
remoteUrl.set(URI("https://github.com/KotlinCrypto/core/tree/master"))
45+
remoteLineSuffix.set("#L")
4046
}
4147

42-
documentedVisibilities.set(setOf(
43-
Visibility.PUBLIC,
44-
Visibility.PROTECTED,
45-
))
48+
documentedVisibilities(
49+
VisibilityModifier.Public,
50+
VisibilityModifier.Protected,
51+
)
52+
}
53+
54+
pluginsConfiguration.html {
55+
footerMessage.set("© 2023-${LocalDate.now().year} Copyright KotlinCrypto")
4656
}
4757
}

build.gradle.kts

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ plugins {
2626
}
2727

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

gh-pages/publish.sh

+2-2
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

+3
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ androidx-test-runner = "1.5.2" # Do not upgrade. Tests run for API 15+, w
55
gradle-benchmark = "0.4.13"
66
gradle-android = "8.7.3"
77
gradle-binary-compat = "0.17.0"
8-
gradle-dokka = "1.9.20"
8+
gradle-dokka = "2.0.0"
99
gradle-kmp-configuration = "0.4.0"
1010
gradle-kotlin = "2.1.10"
1111
gradle-publish-maven = "0.30.0"

test-android/build.gradle.kts

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ plugins {
1717
id("configuration")
1818
}
1919

20-
repositories {
21-
google()
22-
}
20+
repositories { google() }
2321

2422
kmpConfiguration {
2523
configure {

0 commit comments

Comments
 (0)