Skip to content

Commit 71bddb3

Browse files
authored
fix: configure modulePath to preserve Dokka1 module paths (#1617)
1 parent 7ee9e9d commit 71bddb3

File tree

4 files changed

+45
-11
lines changed

4 files changed

+45
-11
lines changed

aws-runtime/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,12 @@ dependencies {
7979
it.plugins.apply("dokka-convention") // Apply the Dokka conventions plugin to the subproject
8080
dokka(project(it.path)) // Aggregate the subprojects' generated documentation
8181
}
82+
83+
// Preserve Dokka v1 module paths
84+
// https://kotlinlang.org/docs/dokka-migration.html#revert-to-the-dgp-v1-directory-behavior
85+
subprojects {
86+
dokka {
87+
modulePath = this@subprojects.name
88+
}
89+
}
8290
}

hll/build.gradle.kts

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,39 @@ subprojects {
9696
}
9797
}
9898

99+
// Projects to ignore for API validation and documentation generation
100+
val projectsToIgnore = listOf(
101+
"hll-codegen",
102+
"dynamodb-mapper-codegen",
103+
"dynamodb-mapper-ops-codegen",
104+
"dynamodb-mapper-schema-codegen",
105+
"dynamodb-mapper-schema-generator-plugin-test",
106+
).filter { it in subprojects.map { it.name }.toSet() } // Some projects may not be in the build depending on bootstrapping
107+
99108
apiValidation {
100-
val availableSubprojects = subprojects.map { it.name }.toSet()
101-
102-
ignoredProjects += listOf(
103-
"hll-codegen",
104-
"dynamodb-mapper-codegen",
105-
"dynamodb-mapper-ops-codegen",
106-
"dynamodb-mapper-schema-codegen",
107-
"dynamodb-mapper-schema-generator-plugin-test",
108-
).filter { it in availableSubprojects } // Some projects may not be in the build depending on bootstrapping
109+
ignoredProjects += projectsToIgnore
109110
}
110111

111112
// Configure Dokka for subprojects
112113
dependencies {
113114
subprojects.forEach {
114-
it.plugins.apply("dokka-convention") // Apply the Dokka conventions plugin to the subproject
115-
dokka(project(it.path)) // Aggregate the subproject's generated documentation
115+
if (it.name !in projectsToIgnore) {
116+
it.plugins.apply("dokka-convention") // Apply the Dokka conventions plugin to the subproject
117+
dokka(project(it.path)) // Aggregate the subproject's generated documentation
118+
}
119+
}
120+
121+
// Preserve Dokka v1 module paths
122+
// https://kotlinlang.org/docs/dokka-migration.html#revert-to-the-dgp-v1-directory-behavior
123+
subprojects {
124+
val subProjectName = this@subprojects.name
125+
126+
if (subProjectName in projectsToIgnore) {
127+
return@subprojects
128+
}
129+
130+
dokka {
131+
modulePath = subProjectName
132+
}
116133
}
117134
}

hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ buildscript {
2626

2727
plugins {
2828
alias(libs.plugins.ksp)
29+
`dokka-convention`
2930
}
3031

3132
kotlin {

services/build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,12 @@ dependencies {
152152
it.plugins.apply("dokka-convention") // Apply the Dokka conventions plugin to the subproject
153153
dokka(project(it.path)) // Aggregate the subproject's generated documentation
154154
}
155+
156+
// Preserve Dokka v1 module paths
157+
// https://kotlinlang.org/docs/dokka-migration.html#revert-to-the-dgp-v1-directory-behavior
158+
subprojects {
159+
dokka {
160+
modulePath = this@subprojects.name
161+
}
162+
}
155163
}

0 commit comments

Comments
 (0)