Skip to content

Commit

Permalink
Update to Dokka 2.0 (#3553)
Browse files Browse the repository at this point in the history
  • Loading branch information
serras authored Dec 17, 2024
1 parent 50a93dc commit 4700828
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 24 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/githubpages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ 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: copy CNAME
run: cp static/CNAME docs

- 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 @@ -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-cache4k/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)
}

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 @@ -18,6 +18,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
56 changes: 34 additions & 22 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import kotlinx.knit.KnitPluginExtension
import kotlinx.validation.ExperimentalBCVApi
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.dokka.gradle.DokkaTaskPartial
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import java.net.URL

allprojects {
if (property("version") == "unspecified") {
Expand Down Expand Up @@ -89,6 +86,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 +133,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(URL("https://github.com/arrow-kt/arrow/blob/main/${srcDir.relativeTo(rootProject.rootDir)}"))
remoteLineSuffix.set("#L")
}
}
Expand All @@ -123,26 +142,19 @@ 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")
footerMessage.set("© Arrow Contributors")
}
}

getByName("knitPrepare").dependsOn(getTasksByName("dokka", true))

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

apiValidation {
Expand Down
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ 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
org.jetbrains.dokka.experimental.tryK2.nowarn=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.9.0"
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 4700828

Please sign in to comment.