@@ -18,10 +18,10 @@ buildscript {
1818}
1919
2020plugins {
21- alias(libs.plugins. dokka)
21+ ` dokka- convention`
2222 // 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
23+ id (libs.plugins.kotlin.multiplatform.get().pluginId ) apply false
24+ id (libs.plugins.kotlin.jvm.get().pluginId ) apply false
2525 alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
2626}
2727
@@ -39,67 +39,9 @@ val testJavaVersion = typedProp<String>("test.java.version")?.let {
3939}
4040
4141allprojects {
42- tasks.withType< org.jetbrains.dokka.gradle.AbstractDokkaTask > ().configureEach {
43- val sdkVersion: String by project
44- moduleVersion.set(sdkVersion)
45-
46- val year = java.time.LocalDate .now().year
47- val pluginConfigMap = mapOf (
48- " org.jetbrains.dokka.base.DokkaBase" to """
49- {
50- "customStyleSheets": [
51- "${rootProject.file(" docs/dokka-presets/css/logo-styles.css" )} ",
52- "${rootProject.file(" docs/dokka-presets/css/aws-styles.css" )} "
53- ],
54- "customAssets": [
55- "${rootProject.file(" docs/dokka-presets/assets/logo-icon.svg" )} ",
56- "${rootProject.file(" docs/dokka-presets/assets/aws_logo_white_59x35.png" )} ",
57- "${rootProject.file(" docs/dokka-presets/scripts/accessibility.js" )} "
58- ],
59- "footerMessage": "© $year , Amazon Web Services, Inc. or its affiliates. All rights reserved.",
60- "separateInheritedMembers" : true,
61- "templatesDir": "${rootProject.file(" docs/dokka-presets/templates" )} "
62- }
63- """ ,
64- )
65- pluginsMapConfiguration.set(pluginConfigMap)
66- }
67-
68- tasks.withType< org.jetbrains.dokka.gradle.DokkaTaskPartial > ().configureEach {
69- // each module can include their own top-level module documentation
70- // see https://kotlinlang.org/docs/kotlin-doc.html#module-and-package-documentation
71- if (project.file(" API.md" ).exists()) {
72- dokkaSourceSets.configureEach {
73- includes.from(project.file(" API.md" ))
74- }
75- }
76-
77- dokkaSourceSets.configureEach {
78- samples.from(project.file(" samples" ).path, project.file(" generated-src/samples" ).path)
79- }
80-
81- val smithyKotlinPackageListUrl: String? by project
82- val smithyKotlinDocBaseUrl: String? by project
83-
84- // Configure Dokka to link to smithy-kotlin types if specified in properties
85- // These optional properties are supplied api the api docs build job but are unneeded otherwise
86- smithyKotlinDocBaseUrl.takeUnless { it.isNullOrEmpty() }?.let { docBaseUrl ->
87- val expandedDocBaseUrl = docBaseUrl.replace(" \$ smithyKotlinRuntimeVersion" , libs.versions.smithy.kotlin.runtime.version.get())
88- dokkaSourceSets.configureEach {
89- externalDocumentationLink {
90- url.set(URL (expandedDocBaseUrl))
91-
92- smithyKotlinPackageListUrl
93- .takeUnless { it.isNullOrEmpty() }
94- ?.let { packageListUrl.set(URL (it)) }
95- }
96- }
97- }
98- }
99-
10042 if (rootProject.typedProp<Boolean >(" kotlinWarningsAsErrors" ) == true ) {
10143 tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
102- kotlinOptions .allWarningsAsErrors = true
44+ compilerOptions .allWarningsAsErrors = true
10345 }
10446 }
10547
@@ -118,26 +60,24 @@ allprojects {
11860 tasks.register<DependencyReportTask >(" allDeps" ) { }
11961}
12062
121- project.afterEvaluate {
122- // configure the root multimodule docs
123- tasks.dokkaHtmlMultiModule.configure {
124- moduleName.set(" AWS SDK for Kotlin" )
125-
126- // Output subprojects' docs to <docs-base>/project-name/* instead of <docs-base>/path/to/project-name/*
127- // This is especially important for inter-repo linking (e.g., via externalDocumentationLink) because the
128- // package-list doesn't contain enough project path information to indicate where modules' documentation are
129- // located.
130- fileLayout.set { parent, child ->
131- parent.outputDirectory.dir(child.moduleName)
132- }
63+ // Configure root module's documentation
64+ dokka {
65+ moduleName.set(" AWS SDK for Kotlin" )
13366
67+ dokkaPublications.html {
13468 includes.from(
135- // NOTE: these get concatenated
13669 rootProject.file(" docs/dokka-presets/README.md" ),
13770 )
13871 }
13972}
14073
74+ // Aggregate subprojects' documentation
75+ dependencies {
76+ dokka(project(" :aws-runtime" ))
77+ dokka(project(" :services" ))
78+ dokka(project(" :hll" ))
79+ }
80+
14181// Publishing
14282configureNexus()
14383
0 commit comments