55import aws.sdk.kotlin.gradle.dsl.configureLinting
66import aws.sdk.kotlin.gradle.dsl.configureNexus
77import aws.sdk.kotlin.gradle.util.typedProp
8- import java.net.URL
98
109buildscript {
1110 // NOTE: buildscript classpath for the root project is the parent classloader for the subprojects, we
@@ -18,10 +17,10 @@ buildscript {
1817}
1918
2019plugins {
21- alias(libs.plugins. dokka)
20+ ` dokka- convention`
2221 // ensure the correct version of KGP ends up on our buildscript classpath
23- alias (libs.plugins.kotlin.multiplatform) apply false
24- alias (libs.plugins.kotlin.jvm) apply false
22+ id (libs.plugins.kotlin.multiplatform.get().pluginId ) apply false
23+ id (libs.plugins.kotlin.jvm.get().pluginId ) apply false
2524 alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
2625}
2726
@@ -39,72 +38,9 @@ val testJavaVersion = typedProp<String>("test.java.version")?.let {
3938}
4039
4140allprojects {
42- apply (from = " ${rootProject.file(" buildSrc/src/main/kotlin/dokka-customization.gradle.kts" )} " )
43-
44- tasks.withType< org.jetbrains.dokka.gradle.AbstractDokkaTask > ().configureEach {
45- val sdkVersion: String by project
46- moduleVersion.set(sdkVersion)
47-
48- val year = java.time.LocalDate .now().year
49- val pluginConfigMap = mapOf (
50- " org.jetbrains.dokka.base.DokkaBase" to """
51- {
52- "customStyleSheets": [
53- "${rootProject.file(" docs/dokka-presets/css/logo-styles.css" )} ",
54- "${rootProject.file(" docs/dokka-presets/css/aws-styles.css" )} "
55- ],
56- "customAssets": [
57- "${rootProject.file(" docs/dokka-presets/assets/logo-icon.svg" )} ",
58- "${rootProject.file(" docs/dokka-presets/assets/aws_logo_white_59x35.png" )} ",
59- "${rootProject.file(" docs/dokka-presets/scripts/accessibility.js" )} ",
60- "${rootProject.file(" docs/dokka-presets/scripts/custom-navigation-loader.js" )} "
61- ],
62- "footerMessage": "© $year , Amazon Web Services, Inc. or its affiliates. All rights reserved.",
63- "separateInheritedMembers" : true,
64- "templatesDir": "${rootProject.file(" docs/dokka-presets/templates" )} "
65- }
66- """ ,
67- )
68- pluginsMapConfiguration.set(pluginConfigMap)
69- }
70-
71- tasks.withType< org.jetbrains.dokka.gradle.DokkaTaskPartial > ().configureEach {
72- dokkaSourceSets.configureEach {
73- samples.from(project.file(" samples" ).path, project.file(" generated-src/samples" ).path)
74-
75- // Each module can include their own top-level module documentation in one or more included Markdown files,
76- // each of which must begin with `# Module <module-name>` where <module-name> is the literal name of the
77- // Gradle module. See https://kotlinlang.org/docs/dokka-module-and-package-docs.html for more details.
78- val includeFiles = setOf (
79- " OVERVIEW.md" , // Auto-generated by ModuleDocumentationIntegration
80- " DOCS.md" , // Hand-written docs explaining a module in greater detail
81- " API.md" , // Auto-generated by `kat` tool
82- ).mapNotNull { project.file(it).takeIf { it.exists() } }
83- includes.from(includeFiles)
84- }
85-
86- val smithyKotlinPackageListUrl: String? by project
87- val smithyKotlinDocBaseUrl: String? by project
88-
89- // Configure Dokka to link to smithy-kotlin types if specified in properties
90- // These optional properties are supplied api the api docs build job but are unneeded otherwise
91- smithyKotlinDocBaseUrl.takeUnless { it.isNullOrEmpty() }?.let { docBaseUrl ->
92- val expandedDocBaseUrl = docBaseUrl.replace(" \$ smithyKotlinRuntimeVersion" , libs.versions.smithy.kotlin.runtime.version.get())
93- dokkaSourceSets.configureEach {
94- externalDocumentationLink {
95- url.set(URL (expandedDocBaseUrl))
96-
97- smithyKotlinPackageListUrl
98- .takeUnless { it.isNullOrEmpty() }
99- ?.let { packageListUrl.set(URL (it)) }
100- }
101- }
102- }
103- }
104-
10541 if (rootProject.typedProp<Boolean >(" kotlinWarningsAsErrors" ) == true ) {
10642 tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
107- kotlinOptions .allWarningsAsErrors = true
43+ compilerOptions .allWarningsAsErrors = true
10844 }
10945 }
11046
@@ -123,28 +59,24 @@ allprojects {
12359 tasks.register<DependencyReportTask >(" allDeps" ) { }
12460}
12561
126- project.afterEvaluate {
127- // configure the root multimodule docs
128- tasks.dokkaHtmlMultiModule.configure {
129- moduleName.set(" AWS SDK for Kotlin" )
130-
131- // Output subprojects' docs to <docs-base>/project-name/* instead of <docs-base>/path/to/project-name/*
132- // This is especially important for inter-repo linking (e.g., via externalDocumentationLink) because the
133- // package-list doesn't contain enough project path information to indicate where modules' documentation are
134- // located.
135- fileLayout.set { parent, child ->
136- parent.outputDirectory.dir(child.moduleName)
137- }
62+ // Configure root module's documentation
63+ dokka {
64+ moduleName.set(" AWS SDK for Kotlin" )
13865
66+ dokkaPublications.html {
13967 includes.from(
140- // NOTE: these get concatenated
14168 rootProject.file(" docs/dokka-presets/README.md" ),
14269 )
143-
144- finalizedBy(" trimNavigations" , " applyCustomNavigationLoader" )
14570 }
14671}
14772
73+ // Aggregate subprojects' documentation
74+ dependencies {
75+ dokka(project(" :aws-runtime" ))
76+ dokka(project(" :services" ))
77+ dokka(project(" :hll" ))
78+ }
79+
14880// Publishing
14981configureNexus()
15082
@@ -155,6 +87,7 @@ val lintPaths = listOf(
15587 " !**/generated/ksp/**" ,
15688 " !**/kspCaches/**" ,
15789 " !**/smithyprojections/**" ,
90+ " !**/build/**" ,
15891)
15992
16093configureLinting(lintPaths)
0 commit comments