From 3cd297efb9c6cce2d9ef06878fb84113204734be Mon Sep 17 00:00:00 2001 From: Matthew Nelson Date: Fri, 14 Feb 2025 11:22:41 -0500 Subject: [PATCH 1/2] Update dokka plugin to v2 --- build-logic/src/main/kotlin/dokka.gradle.kts | 34 ++++++++++++-------- gh-pages/publish.sh | 4 +-- gradle.properties | 3 ++ gradle/libs.versions.toml | 2 +- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/build-logic/src/main/kotlin/dokka.gradle.kts b/build-logic/src/main/kotlin/dokka.gradle.kts index 29775e5..dca5dfa 100644 --- a/build-logic/src/main/kotlin/dokka.gradle.kts +++ b/build-logic/src/main/kotlin/dokka.gradle.kts @@ -13,31 +13,39 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ -import org.jetbrains.dokka.DokkaConfiguration.Visibility -import org.jetbrains.dokka.gradle.DokkaTaskPartial +import org.jetbrains.dokka.gradle.DokkaExtension +import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier import java.net.URI +import java.time.LocalDate plugins { id("org.jetbrains.dokka") } -// TODO: Update to Dokka 2.0.0+ (Issue #9) -tasks.withType().configureEach { - suppressInheritedMembers = true +rootProject.dependencies { dokka(project(project.path)) } + +extensions.configure { + dokkaPublications.configureEach { + suppressInheritedMembers.set(true) + } dokkaSourceSets.configureEach { includes.from("README.md") - noStdlibLink = true + enableKotlinStdLibDocumentationLink.set(false) sourceLink { - localDirectory = rootDir - remoteUrl = URI("https://github.com/KotlinCrypto/error/tree/master").toURL() - remoteLineSuffix = "#L" + localDirectory.set(rootDir) + remoteUrl.set(URI("https://github.com/KotlinCrypto/error/tree/master")) + remoteLineSuffix.set("#L") } - documentedVisibilities.set(setOf( - Visibility.PUBLIC, - Visibility.PROTECTED, - )) + documentedVisibilities( + VisibilityModifier.Public, + VisibilityModifier.Protected, + ) + } + + pluginsConfiguration.html { + footerMessage.set("© 2025-${LocalDate.now().year} Copyright KotlinCrypto") } } diff --git a/gh-pages/publish.sh b/gh-pages/publish.sh index c39e6d5..4ab48fe 100755 --- a/gh-pages/publish.sh +++ b/gh-pages/publish.sh @@ -26,8 +26,8 @@ echo "$REPO_NAME.kotlincrypto.org" > "$DIR_SCRIPT/$REPO_NAME/CNAME" cd .. ./gradlew clean -DKMP_TARGETS_ALL -./gradlew dokkaHtmlMultiModule --no-build-cache -DKMP_TARGETS_ALL -cp -aR build/dokka/htmlMultiModule/* gh-pages/$REPO_NAME +./gradlew dokkaGenerate --no-build-cache -DKMP_TARGETS_ALL +cp -aR build/dokka/html/* gh-pages/$REPO_NAME cd "$DIR_SCRIPT/$REPO_NAME" sed -i "s|module:|module:library/|g" "package-list" diff --git a/gradle.properties b/gradle.properties index 029950a..d1e7058 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,9 @@ kotlin.mpp.applyDefaultHierarchyTemplate=false kotlin.mpp.stability.nowarn=true kotlin.native.ignoreDisabledTargets=true +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true + SONATYPE_HOST=S01 RELEASE_SIGNING_ENABLED=true diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e59669..df7aabd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] gradle-binary-compat = "0.17.0" -gradle-dokka = "1.9.20" +gradle-dokka = "2.0.0" gradle-kmp-configuration = "0.4.0" gradle-kotlin = "2.1.10" gradle-publish-maven = "0.30.0" From 55c37e41c2dfba67be5ed0638385e9fa4dcdc85d Mon Sep 17 00:00:00 2001 From: Matthew Nelson Date: Wed, 19 Feb 2025 12:22:42 -0500 Subject: [PATCH 2/2] Ensure rootProject.group is different from module :library:core.group --- build.gradle.kts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 48995d8..9b2724f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,7 +24,13 @@ plugins { } allprojects { - findProperty("GROUP")?.let { group = it } + // https://github.com/Kotlin/dokka/issues/4030#issuecomment-2669254887 + if (this.project == this.rootProject) { + group = "root" + } else { + findProperty("GROUP")?.let { group = it } + } + findProperty("VERSION_NAME")?.let { version = it } findProperty("POM_DESCRIPTION")?.let { description = it.toString() }