diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 2798c227..e93fb98a 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -36,7 +36,7 @@ jobs: java-version: 17 - name: Generate Dokka HTML docs - run: ./gradlew :dokkaHtml + run: ./gradlew :dokkaGenerate - name: Setup Pages uses: actions/configure-pages@v5 diff --git a/build.gradle.kts b/build.gradle.kts index a826a394..2fa0fd66 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -285,11 +285,27 @@ tasks { // Docs -tasks { - register("dokkaJar") { - from(dokkaHtml) - dependsOn(dokkaHtml) - archiveClassifier.set("javadoc") +tasks.register("javadocJar", Jar::class) { + archiveClassifier.set("javadoc") +} + +dependencies { + dokka(project(":")) +} + +dokka { + moduleName.set("kotlin-logging") + dokkaSourceSets { + configureEach { + sourceLink { + localDirectory.set(project.projectDir.resolve("src")) + remoteUrl.set(uri("https://github.com/oshai/kotlin-logging/tree/master/src")) + remoteLineSuffix.set("#L") + } + } + } + dokkaPublications.html { + outputDirectory.set(project.layout.buildDirectory.dir("dokka")) } } @@ -357,7 +373,7 @@ publishing { url.set("https://github.com/oshai/kotlin-logging/tree/master") } } - artifact(tasks["dokkaJar"]) + } } diff --git a/gradle.properties b/gradle.properties index f030b8bc..5b42b9b3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,3 +4,4 @@ org.gradle.jvmargs=-Xmx2048m # see https://kotlinlang.org/docs/whatsnew18.html#sourcedirectories kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.applyDefaultHierarchyTemplate=false +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled