aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/model/CompositeSourceSetID.kt16
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