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