diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-08-17 10:49:41 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-17 11:52:28 +0200 |
commit | ef1bb10aca292e14d8deb35694243fd84fc75341 (patch) | |
tree | 2aae938883e6c8d1b35948d2da947b0af955bd54 /core/src/main/kotlin/model | |
parent | a2be91ea289ddb1a8634c5fd252243f1b9ab7000 (diff) | |
download | dokka-ef1bb10aca292e14d8deb35694243fd84fc75341.tar.gz dokka-ef1bb10aca292e14d8deb35694243fd84fc75341.tar.bz2 dokka-ef1bb10aca292e14d8deb35694243fd84fc75341.zip |
Rename `ContentSourceSet` to `DisplaySourceSet`
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 } |