package org.jetbrains.dokka.model import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.Platform import org.jetbrains.dokka.plugability.DokkaContext data class SourceSetData( val moduleName: String, val sourceSetID: String, val displayName: String, val platform: Platform, val sourceRoots: List = emptyList(), val dependentSourceSets: List = emptyList() ) class SourceSetCache { private val sourceSets = HashMap() val allSourceSets: List get() = sourceSets.values.toList() fun getSourceSet(pass: DokkaConfiguration.PassConfiguration) = sourceSets.getOrPut(pass.sourceSetID, { SourceSetData( pass.moduleName, pass.sourceSetID, pass.displayName, pass.analysisPlatform, pass.sourceRoots, pass.dependentSourceSets ) } ) } fun DokkaContext.sourceSet(pass: DokkaConfiguration.PassConfiguration): SourceSetData = sourceSetCache.getSourceSet(pass)