33 * Use of this source code is governed by the MIT license that can be found in the LICENSE file.
44 */
55
6+ import org.jetbrains.dokka.gradle.DokkaTask
67import java.time.LocalDateTime
78
89plugins {
910 id(" org.jetbrains.dokka" )
1011}
1112
12- val rootDir = rootProject.projectDir.toString().replace(" \\ " , " /" )
13- val docsDir = " $rootDir /docs"
14- val buildDir = " $docsDir /build"
15- val dokkaDir = projectDir.toString().replace(" \\ " , " /" )
16- val dokkaSrcDir = " $dokkaDir /source"
13+ val libVersion = " 4.11.0"
14+
15+ val rootDirectory = rootProject.projectDir.toString().replace(" \\ " , " /" )
16+ val docsDirectory = " $rootDirectory /docs"
17+ val dokkaDirectory = projectDir.toString().replace(" \\ " , " /" )
18+ val dokkaSrcDirectory = " $dokkaDirectory /source"
1719
1820val gitHubLink = " https://github.com/JetBrains/lets-plot-kotlin"
1921val customFooterMessage = " Copyright © 2019-${LocalDateTime .now().year} JetBrains s.r.o."
20- val customStyleSheet = " $dokkaSrcDir /custom.css"
21- val customScript = " $dokkaSrcDir /custom.js"
22- val logoLightImage = " $docsDir /images/logo-icon.svg"
23- val logoDarkImage = " $docsDir /images/logo-dark.svg"
24- val gitHubImage = " $docsDir /images/homepage.svg"
25-
26- tasks.dokkaHtml {
27- moduleName.set(" Lets-Plot-Kotlin" )
28- outputDirectory.set(File (" $buildDir /api-reference" ))
29- pluginsMapConfiguration.set(
30- mapOf (
31- " org.jetbrains.dokka.base.DokkaBase" to """ {
32- |"customAssets": ["$customScript ", "$logoLightImage ", "$logoDarkImage ", "$gitHubImage "],
33- |"customStyleSheets": ["$customStyleSheet "],
34- |"homepageLink": "$gitHubLink ",
35- |"footerMessage": "$customFooterMessage "
36- |}""" .trimMargin()
22+ val customStyleSheet = " $dokkaSrcDirectory /custom.css"
23+ val customScript = " $dokkaSrcDirectory /custom.js"
24+ val logoLightImage = " $docsDirectory /images/logo-icon.svg"
25+ val logoDarkImage = " $docsDirectory /images/logo-dark.svg"
26+ val gitHubImage = " $docsDirectory /images/homepage.svg"
27+
28+ evaluationDependsOn(" :plot-api" )
29+
30+ rootProject.project(" :plot-api" )
31+ .tasks.named<DokkaTask >(" dokkaHtml" )
32+ .configure {
33+ moduleName.set(" Lets-Plot-Kotlin" )
34+ outputDirectory.set(File (" $docsDirectory /build/api-reference" ))
35+ pluginsMapConfiguration.set(
36+ mapOf (
37+ " org.jetbrains.dokka.base.DokkaBase" to """
38+ {
39+ "homepageLink": "$gitHubLink ",
40+ "footerMessage": "$customFooterMessage ",
41+ "customAssets": [
42+ "$customScript ",
43+ "$logoLightImage ",
44+ "$logoDarkImage ",
45+ "$gitHubImage "
46+ ],
47+ "customStyleSheets": [
48+ "$customStyleSheet "
49+ ]
50+ }
51+ """ .trimIndent()
52+ )
3753 )
38- )
39- dokkaSourceSets {
40- configureEach {
41- skipDeprecated.set(true )
42- includes.from(" $dokkaSrcDir /packages.md" )
43- perPackageOption {
44- matchingRegex.set(""" .*\.frontend.*""" )
45- suppress.set(true )
46- }
47- perPackageOption {
48- matchingRegex.set(""" .*\.intern.*""" )
49- suppress.set(true )
50- }
51- perPackageOption {
52- matchingRegex.set(""" .*\.intern\.layer.*""" )
53- suppress.set(false )
54- }
55- }
56- register(" plotAPI" ) {
57- displayName.set(" Plot API" )
58- sourceRoots.from(" $rootDir /plot-api/src/commonMain" , " $rootDir /plot-api/src/jvmMain" )
59- }
54+ }
55+
56+ gradle.taskGraph.whenReady {
57+ if (hasTask(" :plot-api:dokkaHtml" )) {
58+ rootProject.project(" :plot-api" ).version = libVersion
6059 }
6160}
0 commit comments