Update dokka configuration

This commit is contained in:
Alexander Nozik 2025-03-10 09:26:13 +03:00
parent 8deaf1470a
commit 9d3d08e66b
2 changed files with 18 additions and 12 deletions

@ -2,7 +2,6 @@
[![DOI](https://zenodo.org/badge/129486382.svg)](https://zenodo.org/badge/latestdoi/129486382) [![DOI](https://zenodo.org/badge/129486382.svg)](https://zenodo.org/badge/latestdoi/129486382)
![Gradle build](https://github.com/SciProgCentre/kmath/workflows/Gradle%20build/badge.svg) ![Gradle build](https://github.com/SciProgCentre/kmath/workflows/Gradle%20build/badge.svg)
[![Maven Central](https://img.shields.io/maven-central/v/space.kscience/kmath-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22space.kscience%22) [![Maven Central](https://img.shields.io/maven-central/v/space.kscience/kmath-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22space.kscience%22)
[![Space](https://img.shields.io/badge/dynamic/xml?color=orange&label=Space&query=//metadata/versioning/latest&url=https%3A%2F%2Fmaven.pkg.jetbrains.space%2Fmipt-npm%2Fp%2Fsci%2Fmaven%2Fspace%2Fkscience%2Fkmath-core%2Fmaven-metadata.xml)](https://maven.pkg.jetbrains.space/mipt-npm/p/sci/maven/space/kscience/)
# KMath # KMath

@ -17,7 +17,7 @@ allprojects {
version = "0.4.3-dev-1" version = "0.4.3-dev-1"
} }
dependencies{ dependencies {
subprojects.forEach { subprojects.forEach {
dokka(it) dokka(it)
} }
@ -27,23 +27,29 @@ subprojects {
if (name.startsWith("kmath")) apply<MavenPublishPlugin>() if (name.startsWith("kmath")) apply<MavenPublishPlugin>()
plugins.withId("org.jetbrains.dokka") { plugins.withId("org.jetbrains.dokka") {
tasks.withType<org.jetbrains.dokka.gradle.DokkaTaskPartial> { dokka {
dependsOn(tasks["assemble"]) dokkaSourceSets.configureEach {
val readmeFile = projectDir.resolve("README.md")
dokkaSourceSets.all {
val readmeFile = this@subprojects.projectDir.resolve("README.md")
if (readmeFile.exists()) includes.from(readmeFile) if (readmeFile.exists()) includes.from(readmeFile)
val kotlinDirPath = "src/$name/kotlin" val kotlinDirPath = "src/$name/kotlin"
val kotlinDir = file(kotlinDirPath) val kotlinDir = file(kotlinDirPath)
if (kotlinDir.exists()) sourceLink { if (kotlinDir.exists()) sourceLink {
localDirectory.set(kotlinDir) localDirectory.set(kotlinDir)
remoteUrl(
remoteUrl.set( "https://github.com/SciProgCentre/kmath/tree/master/${name}/$kotlinDirPath"
uri("https://github.com/SciProgCentre/kmath/tree/master/${this@subprojects.name}/$kotlinDirPath").toURL()
) )
} }
fun externalDocumentationLink(url: String, packageListUrl: String? = null){
externalDocumentationLinks.register(url) {
url(url)
packageListUrl?.let {
packageListUrl(it)
}
}
}
externalDocumentationLink("https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/") externalDocumentationLink("https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/")
externalDocumentationLink("https://deeplearning4j.org/api/latest/") externalDocumentationLink("https://deeplearning4j.org/api/latest/")
externalDocumentationLink("https://axelclk.bitbucket.io/symja/javadoc/") externalDocumentationLink("https://axelclk.bitbucket.io/symja/javadoc/")
@ -54,11 +60,12 @@ subprojects {
) )
externalDocumentationLink( externalDocumentationLink(
"https://breandan.net/kotlingrad/kotlingrad/", "https://breandan.net/kotlingrad/kotlingrad",
"https://breandan.net/kotlingrad/kotlingrad/kotlingrad/package-list", "https://breandan.net/kotlingrad/package-list",
) )
} }
} }
} }
} }