diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-04-21 13:10:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 13:10:03 +0200 |
commit | db337c6b489d41f7c62bc44f9edb3e5eaa62e0d5 (patch) | |
tree | 977bff9096271ac32635ebece028005d80ea0e89 /core/src/main/kotlin/model | |
parent | 7976824f185ac846f687971cca449da2e4c24728 (diff) | |
download | dokka-db337c6b489d41f7c62bc44f9edb3e5eaa62e0d5.tar.gz dokka-db337c6b489d41f7c62bc44f9edb3e5eaa62e0d5.tar.bz2 dokka-db337c6b489d41f7c62bc44f9edb3e5eaa62e0d5.zip |
Make anchors stable (#1851)
* Make anchors stable
* Remove backing field from merged and all in CompositeSourceSetID
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r-- | core/src/main/kotlin/model/CompositeSourceSetID.kt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/src/main/kotlin/model/CompositeSourceSetID.kt b/core/src/main/kotlin/model/CompositeSourceSetID.kt index e14b01df..3eaf6407 100644 --- a/core/src/main/kotlin/model/CompositeSourceSetID.kt +++ b/core/src/main/kotlin/model/CompositeSourceSetID.kt @@ -13,12 +13,16 @@ data class CompositeSourceSetID( require(children.isNotEmpty()) { "Expected at least one source set id" } } - val merged = DokkaSourceSetID( - scopeId = children.joinToString(separator = "+") { it.scopeId }, - sourceSetName = children.joinToString(separator = "+") { it.sourceSetName } - ) - - val all: Set<DokkaSourceSetID> = setOf(merged, *children.toTypedArray()) + val merged: DokkaSourceSetID + get() = children.sortedBy { it.scopeId + it.sourceSetName }.let { sortedChildren -> + DokkaSourceSetID( + scopeId = sortedChildren.joinToString(separator = "+") { it.scopeId }, + sourceSetName = sortedChildren.joinToString(separator = "+") { it.sourceSetName } + ) + } + + val all: Set<DokkaSourceSetID> + get() = setOf(merged, *children.toTypedArray()) operator fun contains(sourceSetId: DokkaSourceSetID): Boolean { return sourceSetId in all |