All Downloads are FREE. Search and download functionalities are using the official Maven repository.

model.DisplaySourceSet.kt Maven / Gradle / Ivy

Go to download

Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java

There is a newer version: 2.0.0
Show newest version
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

/**
 * TODO: fix the example (asymmetric equivalence relation with [Set]):
 * ```
 * val ds = DokkaSourceSetImpl(sourceSetID = DokkaSourceSetID("", "")).toDisplaySourceSet()
 * println(setOf(ds) == ds) // true
 * println(ds == setOf(ds)) // false
 * ```
 */
data class DisplaySourceSet(
    val sourceSetIDs: CompositeSourceSetID,
    val name: String,
    val platform: Platform
) : SelfRepresentingSingletonSet {
    constructor(sourceSet: DokkaSourceSet) : this(
        sourceSetIDs = CompositeSourceSetID(sourceSet.sourceSetID),
        name = sourceSet.displayName,
        platform = sourceSet.analysisPlatform
    )
}

fun DokkaSourceSet.toDisplaySourceSet(): DisplaySourceSet = DisplaySourceSet(this)

fun Iterable.toDisplaySourceSets(): Set = map { it.toDisplaySourceSet() }.toSet()

val Iterable.sourceSetIDs: List get() = this.flatMap { it.sourceSetIDs.all }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy