aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/kotlin/model/SourceSetData.kt2
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt13
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt2
3 files changed, 9 insertions, 8 deletions
diff --git a/core/src/main/kotlin/model/SourceSetData.kt b/core/src/main/kotlin/model/SourceSetData.kt
index 7d118470..3e38cc7b 100644
--- a/core/src/main/kotlin/model/SourceSetData.kt
+++ b/core/src/main/kotlin/model/SourceSetData.kt
@@ -20,7 +20,7 @@ class SourceSetCache {
get() = sourceSets.values.toList()
fun getSourceSet(pass: DokkaConfiguration.PassConfiguration) =
- sourceSets.getOrPut("${pass.moduleName}/${pass.sourceSetID}",
+ sourceSets.getOrPut(pass.sourceSetID,
{
SourceSetData(
pass.moduleName,
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
index 4aa7632e..d33b41bf 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
@@ -77,7 +77,7 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer {
append("/")
}
- val sourceSetName = sourceSet.sourceSetName
+ val sourceSetName = sourceSet.displayName
if (sourceSetName != null.toString()) {
append(" ($sourceSetName)")
}
@@ -91,7 +91,7 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer {
private fun isUndocumented(documentable: Documentable, sourceSet: SourceSetData): Boolean {
fun resolveDependentSourceSets(sourceSet: SourceSetData): List<SourceSetData> {
return sourceSet.dependentSourceSets.map { sourceSetName ->
- documentable.sourceSets.single { it.sourceSetName == sourceSetName }
+ documentable.sourceSets.single { it.sourceSetID == sourceSetName }
}
}
@@ -111,11 +111,12 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer {
}
private fun passConfiguration(context: DokkaContext, sourceSet: SourceSetData): PassConfiguration {
- return context.configuration.passesConfigurations.single { configuration ->
- // TODO: Use sourceSetID after gradle-rewrite
- configuration.sourceSetName == sourceSet.sourceSetName &&
- configuration.analysisPlatform == sourceSet.platform
+ val passes = context.configuration.passesConfigurations.filter { configuration ->
+ configuration.sourceSetID == sourceSet.sourceSetID
}
+ if (passes.size > 1)
+ context.logger.error("Expected one passConfiguration with ID: ${sourceSet.sourceSetID} found: ${passes.size}")
+ return passes.first()
}
private fun isFakeOverride(documentable: Documentable, sourceSet: SourceSetData): Boolean {
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
index bedbad18..cad5e34f 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt
@@ -285,7 +285,7 @@ open class DokkaTask : DefaultTask(), Configurable {
config.moduleName = project.name
}
if (config.sourceSetID.isBlank()) {
- config.sourceSetID = config.name.takeIf(String::isNotBlank) ?: config.analysisPlatform.key
+ config.sourceSetID = config.moduleName + "/" + config.name
}
config.dependentSourceSets = config.dependentSourceSets.map { config.moduleName + "/" + it }.toMutableList()
if (config.displayName.isBlank()) {