Skip to content

Commit

Permalink
Add option to merge no expect-actual declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Jan 18, 2022
1 parent f7db503 commit d7c049e
Show file tree
Hide file tree
Showing 5 changed files with 333 additions and 147 deletions.
3 changes: 2 additions & 1 deletion integration-tests/gradle/projects/stdlib/stdlib.diff
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ diff --git a/build.gradle b/build.gradle
index aa8f21b..dd6a2ae 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,80 +1,424 @@
@@ -1,80 +1,425 @@
+import org.jetbrains.dokka.Platform
+
plugins {
Expand Down Expand Up @@ -162,6 +162,7 @@ index aa8f21b..dd6a2ae 100644
+ task dokkaStdlib(type: org.jetbrains.dokka.gradle.DokkaTask) {
+ outputDirectory.set(new File(outputDir, "/kotlin-stdlib"))
+ moduleName.set("kotlin-stdlib")
+ pluginsMapConfiguration.set(["org.jetbrains.dokka.base.DokkaBase": """{ "mergeNoExpectActualDeclarations": "true" }"""])
+ dokkaSourceSets {
+ register("kotlin-stdlib-common") {
+ skipDeprecated.set(false)
Expand Down
4 changes: 3 additions & 1 deletion plugins/base/src/main/kotlin/DokkaBaseConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ data class DokkaBaseConfiguration(
var customStyleSheets: List<File> = defaultCustomStyleSheets,
var customAssets: List<File> = defaultCustomAssets,
var separateInheritedMembers: Boolean = separateInheritedMembersDefault,
var footerMessage: String = defaultFooterMessage
var footerMessage: String = defaultFooterMessage,
var mergeNoExpectActualDeclarations: Boolean = mergeNoExpectActualDeclarationsDefault
) : ConfigurableBlock {
companion object {
val defaultFooterMessage = "© ${Year.now().value} Copyright"
val defaultCustomStyleSheets: List<File> = emptyList()
val defaultCustomAssets: List<File> = emptyList()
const val separateInheritedMembersDefault: Boolean = false
const val mergeNoExpectActualDeclarationsDefault: Boolean = false
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class SameMethodNamePageMergerStrategy(val logger: DokkaLogger) : PageMergerStra
.reduce { acc, node ->
acc.mapTransform<ContentDivergentGroup, ContentNode> { g ->
g.copy(children = (g.children +
(node.dfs { it is ContentDivergentGroup && it.groupID == g.groupID } as? ContentDivergentGroup)
?.children?.single()
).filterNotNull()
((node.dfs { it is ContentDivergentGroup && it.groupID == g.groupID } as? ContentDivergentGroup)
?.children ?: emptyList())
)
)
}
}
Expand Down

0 comments on commit d7c049e

Please sign in to comment.