diff options
Diffstat (limited to 'core/src/main/kotlin/model')
-rw-r--r-- | core/src/main/kotlin/model/ContentSourceSet.kt | 24 | ||||
-rw-r--r-- | core/src/main/kotlin/model/DisplaySourceSet.kt | 25 |
2 files changed, 25 insertions, 24 deletions
diff --git a/core/src/main/kotlin/model/ContentSourceSet.kt b/core/src/main/kotlin/model/ContentSourceSet.kt deleted file mode 100644 index 8a1bf53c..00000000 --- a/core/src/main/kotlin/model/ContentSourceSet.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.jetbrains.dokka.model - -import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet -import org.jetbrains.dokka.DokkaSourceSetID -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.utilities.SelfRepresentingSingletonSet - -data class ContentSourceSet( - val sourceSetIDs: CompositeSourceSetID, - val displayName: String, - val analysisPlatform: Platform -) : SelfRepresentingSingletonSet<ContentSourceSet> { - constructor(sourceSet: DokkaSourceSet) : this( - sourceSetIDs = CompositeSourceSetID(sourceSet.sourceSetID), - displayName = sourceSet.displayName, - analysisPlatform = sourceSet.analysisPlatform - ) -} - -fun DokkaSourceSet.toContentSourceSet(): ContentSourceSet = ContentSourceSet(this) - -fun Iterable<DokkaSourceSet>.toContentSourceSets(): Set<ContentSourceSet> = map { it.toContentSourceSet() }.toSet() - -val Iterable<ContentSourceSet>.sourceSetIDs: List<DokkaSourceSetID> get() = this.flatMap { it.sourceSetIDs.all } diff --git a/core/src/main/kotlin/model/DisplaySourceSet.kt b/core/src/main/kotlin/model/DisplaySourceSet.kt new file mode 100644 index 00000000..4f1387aa --- /dev/null +++ b/core/src/main/kotlin/model/DisplaySourceSet.kt @@ -0,0 +1,25 @@ +package org.jetbrains.dokka.model + +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet +import org.jetbrains.dokka.DokkaSourceSetID +import org.jetbrains.dokka.Platform +import org.jetbrains.dokka.utilities.SelfRepresentingSingletonSet + +data class DisplaySourceSet( + val sourceSetIDs: CompositeSourceSetID, + val name: String, + val platform + : Platform +) : SelfRepresentingSingletonSet<DisplaySourceSet> { + constructor(sourceSet: DokkaSourceSet) : this( + sourceSetIDs = CompositeSourceSetID(sourceSet.sourceSetID), + name = sourceSet.displayName, + platform = sourceSet.analysisPlatform + ) +} + +fun DokkaSourceSet.toDisplaySourceSet(): DisplaySourceSet = DisplaySourceSet(this) + +fun Iterable<DokkaSourceSet>.toDisplaySourceSets(): Set<DisplaySourceSet> = map { it.toDisplaySourceSet() }.toSet() + +val Iterable<DisplaySourceSet>.sourceSetIDs: List<DokkaSourceSetID> get() = this.flatMap { it.sourceSetIDs.all } |