3
3
* SPDX-License-Identifier: Apache-2.0
4
4
*/
5
5
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
6
+ import java.time.LocalDate
6
7
7
8
/*
8
9
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
9
10
* SPDX-License-Identifier: Apache-2.0
10
11
*/
11
12
plugins {
13
+ alias(libs.plugins.dokka)
12
14
alias(libs.plugins.kotlin.jvm)
13
15
}
14
16
@@ -17,6 +19,16 @@ description = "Custom Dokka plugin for Kotlin Smithy SDK API docs"
17
19
dependencies {
18
20
compileOnly(libs.dokka.base)
19
21
compileOnly(libs.dokka.core)
22
+
23
+ testImplementation(libs.jsoup)
24
+ testImplementation(libs.junit.jupiter)
25
+ testImplementation(libs.kotest.assertions.core.jvm)
26
+ testImplementation(libs.kotlin.test.junit5)
27
+ }
28
+
29
+ tasks.test {
30
+ useJUnitPlatform()
31
+ dependsOn(tasks.dokkaHtml)
20
32
}
21
33
22
34
tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
@@ -30,3 +42,29 @@ tasks.withType<JavaCompile> {
30
42
sourceCompatibility = JavaVersion .VERSION_1_8 .toString()
31
43
targetCompatibility = JavaVersion .VERSION_1_8 .toString()
32
44
}
45
+
46
+ tasks.withType< org.jetbrains.dokka.gradle.AbstractDokkaTask > ().configureEach {
47
+ val sdkVersion: String by project
48
+ moduleVersion.set(sdkVersion)
49
+
50
+ val year = LocalDate .now().year
51
+ val pluginConfigMap = mapOf (
52
+ " org.jetbrains.dokka.base.DokkaBase" to """
53
+ {
54
+ "customStyleSheets": [
55
+ "${rootProject.file(" docs/dokka-presets/css/logo-styles.css" ).absolutePath.replace(" \\ " , " /" )} ",
56
+ "${rootProject.file(" docs/dokka-presets/css/aws-styles.css" ).absolutePath.replace(" \\ " , " /" )} "
57
+ ],
58
+ "customAssets": [
59
+ "${rootProject.file(" docs/dokka-presets/assets/logo-icon.svg" ).absolutePath.replace(" \\ " , " /" )} ",
60
+ "${rootProject.file(" docs/dokka-presets/assets/aws_logo_white_59x35.png" ).absolutePath.replace(" \\ " , " /" )} ",
61
+ "${rootProject.file(" docs/dokka-presets/scripts/accessibility.js" ).absolutePath.replace(" \\ " , " /" )} "
62
+ ],
63
+ "footerMessage": "© $year , Amazon Web Services, Inc. or its affiliates. All rights reserved.",
64
+ "separateInheritedMembers" : true,
65
+ "templatesDir": "${rootProject.file(" docs/dokka-presets/templates" ).absolutePath.replace(" \\ " , " /" )} "
66
+ }
67
+ """ ,
68
+ )
69
+ pluginsMapConfiguration.set(pluginConfigMap)
70
+ }
0 commit comments