Skip to content

Commit

Permalink
Update to Dokka 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Dec 16, 2024
1 parent 65f817c commit 7daa263
Show file tree
Hide file tree
Showing 23 changed files with 72 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/githubpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cache-read-only: ${{ github.ref != 'refs/heads/main' }}

- name: assemble
run: ./gradlew -Pversion=${{ github.event.release.tag_name }} dokkaHtmlMultiModule -Pgithubpages=true --max-workers 1
run: ./gradlew -Pversion=${{ github.event.release.tag_name }} :dokkaGenerate -Pgithubpages=true

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v4
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-atomic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-autoclose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-cache4k/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
id(libs.plugins.kotlin.multiplatform.get().pluginId)
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

apply(from = property("ANIMALSNIFFER_MPP"))
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-core-high-arity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-core-retrofit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.kotlinx.serialization) // Needed for testing only
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-core-serialization/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
id(libs.plugins.kotlinx.serialization.get().pluginId)
}

Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-eval/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-functions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/core/arrow-platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/fx/arrow-collectors/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.spotless)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.dokka)
}

apply(from = property("ANIMALSNIFFER_MPP"))
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/fx/arrow-fx-stm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/optics/arrow-optics-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ plugins {
alias(libs.plugins.compose.jetbrains)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.library)
alias(libs.plugins.dokka)
}

apply(from = property("ANIMALSNIFFER_MPP"))
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/optics/arrow-optics-reflect/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/optics/arrow-optics/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
1 change: 1 addition & 0 deletions arrow-libs/resilience/arrow-resilience/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
alias(libs.plugins.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}

spotless {
Expand Down
59 changes: 42 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import kotlinx.knit.KnitPluginExtension
import kotlinx.validation.ExperimentalBCVApi
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.DokkaBaseConfiguration
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
Expand Down Expand Up @@ -89,6 +91,28 @@ allprojects {
group = property("projects.group").toString()
}

dependencies {
dokka(projects.arrowAnnotations)
dokka(projects.arrowAtomic)
dokka(projects.arrowAutoclose)
dokka(projects.arrowCore)
dokka(projects.arrowCoreHighArity)
dokka(projects.arrowCoreRetrofit)
dokka(projects.arrowCoreSerialization)
dokka(projects.arrowCache4k)
dokka(projects.arrowEval)
dokka(projects.arrowFunctions)
dokka(projects.arrowPlatform)
dokka(projects.arrowFxCoroutines)
dokka(projects.arrowFxStm)
dokka(projects.arrowCollectors)
dokka(projects.arrowOptics)
dokka(projects.arrowOpticsReflect)
dokka(projects.arrowOpticsCompose)
dokka(projects.arrowResilience)
}


private val kotlinXUpstream =
setOf(
"arrow-fx-coroutines",
Expand All @@ -114,7 +138,7 @@ subprojects {
kotlinSourceSet.kotlin.srcDirs.filter { it.exists() }.forEach { srcDir ->
sourceLink {
localDirectory.set(srcDir)
remoteUrl.set(uri("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relativeTo(rootProject.rootDir)}").toURL())
remoteUrl.set(uri("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relativeTo(rootProject.rootDir)}").toURL())
remoteLineSuffix.set("#L")
}
}
Expand All @@ -123,26 +147,27 @@ remoteUrl.set(uri("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relative
}
}

tasks {
val undocumentedProjects =
listOf(project(":arrow-optics-ksp-plugin"))

val copyCNameFile = register<Copy>("copyCNameFile") {
from(layout.projectDirectory.dir("static").file("CNAME"))
into(layout.projectDirectory.dir("docs"))
dokka {
dokkaPublications.html {
outputDirectory.set(layout.projectDirectory.dir("docs"))
}

dokkaHtmlMultiModule {
dependsOn(copyCNameFile)
removeChildTasks(undocumentedProjects)
moduleName.set("Arrow")
pluginsConfiguration.html {
customAssets.from("static/img/logo/logo-icon.svg")
}
}

getByName("knitPrepare").dependsOn(getTasksByName("dokka", true))
val copyCNameFile = tasks.register<Copy>("copyCNameFile") {
from(layout.projectDirectory.dir("static").file("CNAME"))
into(layout.projectDirectory.dir("docs"))
}

withType<DokkaMultiModuleTask>().configureEach {
outputDirectory.set(file("docs"))
moduleName.set("Arrow")
}
tasks.dokkaGenerate {
dependsOn(copyCNameFile)
}

tasks.getByName("knitPrepare") {
dependsOn(tasks.dokkaGenerate, true)
}

apiValidation {
Expand Down
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ systemProp.org.gradle.internal.publish.checksums.insecure=true
kotlin.stdlib.default.dependency=false
kotlin.mpp.applyDefaultHierarchyTemplate=false

org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
org.jetbrains.dokka.experimental.tryK2=true

ANIMALSNIFFER=../../gradle/animalsniffer.gradle
ANIMALSNIFFER_MPP=../../gradle/animalsniffer-mpp.gradle

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ animalSniffer = "1.7.2"
arrowGradleConfig = "0.12.0-rc.24"
coroutines = "1.9.0"
classgraph = "4.8.179"
dokka = "1.9.20"
dokka = "2.0.0"
kotest = "6.0.0.M1"
kover = "0.8.3"
kotlin = "2.1.0"
Expand Down
6 changes: 6 additions & 0 deletions static/img/logo/logo-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7daa263

Please sign in to comment.