33 * SPDX-License-Identifier: Apache-2.0.
44 */
55import java.util.Properties
6+ import java.net.URL
67
78plugins {
89 kotlin(" jvm" ) version " 1.5.31" apply false
910 id(" org.jetbrains.dokka" )
1011 id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1.0"
1112}
1213
13- dependencies {
14- dokkaPlugin(project(" :dokka-aws" ))
15- }
16-
1714allprojects {
1815 repositories {
1916 mavenLocal()
2017 mavenCentral()
21- // for dokka
22- maven(" https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven" ) {
23- content {
24- includeGroup(" org.jetbrains.kotlinx" )
25- }
26- }
27- }
28-
29- tasks.withType< org.jetbrains.dokka.gradle.DokkaTaskPartial > ().configureEach {
30- // each module can include their own top-level module documentation
31- // see https://kotlinlang.org/docs/kotlin-doc.html#module-and-package-documentation
32- if (project.file(" API.md" ).exists()) {
33- dokkaSourceSets.configureEach {
34- includes.from(project.file(" API.md" ))
35- }
36- }
3718 }
3819
3920 tasks.withType< org.jetbrains.dokka.gradle.AbstractDokkaTask > ().configureEach {
@@ -44,19 +25,40 @@ allprojects {
4425 val pluginConfigMap = mapOf (
4526 " org.jetbrains.dokka.base.DokkaBase" to """
4627 {
47- "customStyleSheets": ["${rootProject.file(" docs/api /css/logo-styles.css" )} "],
28+ "customStyleSheets": ["${rootProject.file(" docs/dokka-presets /css/logo-styles.css" )} "],
4829 "customAssets": [
49- "${rootProject.file(" docs/api /assets/logo-icon.svg" )} ",
50- "${rootProject.file(" docs/api /assets/aws_logo_white_59x35.png" )} "
30+ "${rootProject.file(" docs/dokka-presets /assets/logo-icon.svg" )} ",
31+ "${rootProject.file(" docs/dokka-presets /assets/aws_logo_white_59x35.png" )} "
5132 ],
52- "footerMessage": "© $year , Amazon Web Services, Inc. or its affiliates. All rights reserved."
33+ "footerMessage": "© $year , Amazon Web Services, Inc. or its affiliates. All rights reserved.",
34+ "separateInheritedMembers" : true
5335 }
5436 """
5537 )
5638 pluginsMapConfiguration.set(pluginConfigMap)
5739 }
5840}
5941
42+ subprojects {
43+ tasks.withType< org.jetbrains.dokka.gradle.DokkaTaskPartial > ().configureEach {
44+ // each module can include their own top-level module documentation
45+ // see https://kotlinlang.org/docs/kotlin-doc.html#module-and-package-documentation
46+ if (project.file(" API.md" ).exists()) {
47+ dokkaSourceSets.configureEach {
48+ includes.from(project.file(" API.md" ))
49+ }
50+ }
51+
52+ // Configure Dokka to link to smithy-kotlin types
53+ dokkaSourceSets.configureEach {
54+ externalDocumentationLink {
55+ packageListUrl.set(URL (" https://raw.githubusercontent.com/awslabs/smithy-kotlin/api-docs/package-list" ))
56+ url.set(URL (" https://awslabs.github.io/smithy-kotlin/runtime/" ))
57+ }
58+ }
59+ }
60+ }
61+
6062val localProperties: Map <String , Any > by lazy {
6163 val props = Properties ()
6264
@@ -84,20 +86,29 @@ if (project.prop("kotlinWarningsAsErrors")?.toString()?.toBoolean() == true) {
8486}
8587
8688// configure the root multimodule docs
87- tasks.dokkaHtmlMultiModule {
89+ tasks.dokkaHtmlMultiModule.configure {
8890 moduleName.set(" AWS Kotlin SDK" )
8991
9092 includes.from(
9193 // NOTE: these get concatenated
92- rootProject.file(" docs/api /README.md" ),
93- rootProject.file(" docs/GettingStarted.md" )
94+ rootProject.file(" docs/dokka-presets /README.md" ),
95+ rootProject.file(" docs/GettingStarted.md" ),
9496 )
9597
9698 val excludeFromDocumentation = listOf (
9799 project(" :aws-runtime:testing" ),
98- project(" :aws-runtime:crt-util" )
100+ project(" :aws-runtime:crt-util" ),
99101 )
100102 removeChildTasks(excludeFromDocumentation)
103+
104+ // This allows docs generation to be overridden on the command line.
105+ // Used to generate each AWS service individually.
106+ if (project.hasProperty(" dokkaOutSubDir" )) {
107+ val subDir = project.prop(" dokkaOutSubDir" );
108+ val targetDir = buildDir.resolve(" dokka/$subDir " )
109+ println (" Generating docs in $targetDir " )
110+ outputDirectory.set(targetDir)
111+ }
101112}
102113
103114if (
0 commit comments