Не подтверждена Коммит 95de2c0a создал по автору renovate[bot]'s avatar renovate[bot] Зафиксировано автором GitHub
Просмотр файлов

KTOR-8289 Update dokka to v2 (major) (#4555)



* Update dokka to v2
* Add project ktor-dokka to generate API reference
* Add links to sources
* Change footer message and title
* Use Ktor logo

---------

Co-authored-by: default avatarrenovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: default avatarOsip Fatkullin <osip.fatkullin@jetbrains.com>
владелец 1b6a2e4c
......@@ -2,28 +2,15 @@
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import ktorbuild.internal.libs
import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
import org.jetbrains.kotlin.gradle.targets.js.yarn.yarn
plugins {
id("org.jetbrains.dokka")
}
dependencies {
dokkaPlugin(libs.dokka.plugin.versioning)
}
if (project == rootProject) {
tasks.withType<DokkaMultiModuleTask>().configureEach {
val version = project.version
val dokkaOutputDir = "../versions"
val id = "org.jetbrains.dokka.versioning.VersioningPlugin"
val config = """{ "version": "$version", "olderVersionsDir":"$dokkaOutputDir" }"""
outputDirectory = project.layout.projectDirectory.dir("$dokkaOutputDir/$version")
pluginsMapConfiguration = mapOf(id to config)
dokka {
dokkaSourceSets.configureEach {
sourceLink {
localDirectory = rootDir
remoteUrl("https://github.com/ktorio/ktor/blob/$version")
}
}
yarn.ignoreScripts = false
}
......@@ -8,12 +8,14 @@ extra["publishLocal"] = project.hasProperty("publishLocal")
apply(from = "gradle/verifier.gradle")
val internalProjects = listOf(
"ktor-client-content-negotiation-tests",
"ktor-client-test-base",
"ktor-client-tests",
"ktor-serialization-kotlinx-tests",
"ktor-serialization-tests",
"ktor-server-test-base",
"ktor-server-test-suites",
"ktor-server-tests",
"ktor-client-content-negotiation-tests",
"ktor-test-base",
)
......@@ -24,6 +26,7 @@ extra["relocatedArtifacts"] = mapOf(
val nonDefaultProjectStructure by extra {
listOf(
"ktor-dokka",
"ktor-bom",
"ktor-java-modules-test",
)
......@@ -32,7 +35,6 @@ val nonDefaultProjectStructure by extra {
plugins {
id("ktorbuild.doctor")
id("ktorbuild.compatibility")
id("ktorbuild.dokka")
}
println("Build version: ${project.version}")
......
......@@ -58,6 +58,8 @@ kotlin.daemon.useFallbackStrategy=false
# dokka
# workaround for resolving platform dependencies, see https://github.com/Kotlin/dokka/issues/3153
org.jetbrains.dokka.classpath.useNativeDistributionAccessor=true
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
# Uncomment to skip attempts to publish Develocity build scans
# Add this property to ~/.gradle/gradle.properties to avoid polluting git with unwanted changes
......
......@@ -8,7 +8,7 @@ coroutines = "1.10.1"
atomicfu = "0.27.0"
serialization = "1.8.0"
binaryCompatibilityValidator = "0.17.0"
dokka = "1.9.20"
dokka = "2.0.0"
kover = "0.9.1"
kotlinter = "5.0.1"
kotlinx-browser = "0.3"
......
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">
<linearGradient id="a" gradientUnits="userSpaceOnUse" x1="1" x2="31" y1="17" y2="47">
<stop offset="0" stop-color="#6b57ff"/>
<stop offset=".5" stop-color="#ff45ed"/>
<stop offset="1" stop-color="#dd1265"/>
</linearGradient>
<path d="M0 16 L16 0 L48 32 L32 48z" fill="url(#a)" />
<path fill="#27282C" d="M32 16 H16 v16 h16z"/>
</svg>
/*
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/
import java.time.Year
plugins {
id("ktorbuild.base")
id("ktorbuild.dokka")
}
dependencies {
rootProject.subprojects.forEach { subproject ->
if (subproject != project && subproject.hasDokka) dokka(subproject)
}
dokkaHtmlPlugin(libs.dokka.plugin.versioning)
}
val projectVersion = project.version.toString()
val dokkaVersionsDirectory = resolveVersionsDirectory()
dokka {
moduleName = "Ktor"
pluginsConfiguration {
html {
customAssets.from("assets/logo-icon.svg")
footerMessage = "© ${Year.now()} JetBrains s.r.o and contributors. Apache License 2.0"
}
versioning {
version = projectVersion
if (dokkaVersionsDirectory != null) olderVersionsDir = dokkaVersionsDirectory
}
}
dokkaPublications.html {
if (dokkaVersionsDirectory != null) outputDirectory = dokkaVersionsDirectory.dir(projectVersion)
}
}
fun resolveVersionsDirectory(): Directory? {
val outputDirectory = project.findProperty("ktor.dokka.versionsDirectory") as? String
return outputDirectory?.let(rootProject.layout.projectDirectory::dir)
}
val Project.hasDokka: Boolean get() = plugins.hasPlugin("ktorbuild.dokka")
......@@ -138,3 +138,4 @@ include(":ktor-shared:ktor-websockets")
include(":ktor-shared:ktor-sse")
include(":ktor-shared:ktor-test-base")
include(":ktor-java-modules-test")
include(":ktor-dokka")
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать