aboutsummaryrefslogtreecommitdiff
path: root/kotlin-analysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'kotlin-analysis/src')
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt4
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt14
2 files changed, 12 insertions, 6 deletions
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt
index 38b0b69b..ea8ce2f6 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt
@@ -10,7 +10,7 @@ import java.io.File
internal fun createEnvironmentAndFacade(
logger: DokkaLogger,
- configuration: DokkaConfiguration,
+ sourceSets: List<DokkaConfiguration.DokkaSourceSet>,
sourceSet: DokkaConfiguration.DokkaSourceSet
): EnvironmentAndFacade =
AnalysisEnvironment(DokkaMessageCollector(logger), sourceSet.analysisPlatform).run {
@@ -20,7 +20,7 @@ internal fun createEnvironmentAndFacade(
sourceSet.classpath.forEach(::addClasspath)
addSources(
- (sourceSet.sourceRoots + configuration.sourceSets.filter { it.sourceSetID in sourceSet.dependentSourceSets }
+ (sourceSet.sourceRoots + sourceSets.filter { it.sourceSetID in sourceSet.dependentSourceSets }
.flatMap { it.sourceRoots })
)
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt
index b37c6688..e7c26c25 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/KotlinAnalysis.kt
@@ -6,12 +6,13 @@ import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.DokkaSourceSetID
import org.jetbrains.dokka.model.SourceSetDependent
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.utilities.DokkaLogger
-fun KotlinAnalysis(context: DokkaContext): KotlinAnalysis {
- val environments = context.configuration.sourceSets.associateWith { sourceSet ->
+fun KotlinAnalysis(sourceSets: List<DokkaSourceSet>, logger: DokkaLogger): KotlinAnalysis {
+ val environments = sourceSets.associateWith { sourceSet ->
createEnvironmentAndFacade(
- logger = context.logger,
- configuration = context.configuration,
+ logger = logger,
+ sourceSets = sourceSets,
sourceSet = sourceSet
)
}
@@ -19,6 +20,11 @@ fun KotlinAnalysis(context: DokkaContext): KotlinAnalysis {
return KotlinAnalysisImpl(environments)
}
+@Deprecated(message = "Construct using list of DokkaSourceSets and logger",
+ replaceWith = ReplaceWith("KotlinAnalysis(context.configuration.sourceSets, context.logger)")
+)
+fun KotlinAnalysis(context: DokkaContext): KotlinAnalysis = KotlinAnalysis(context.configuration.sourceSets, context.logger)
+
interface KotlinAnalysis : SourceSetDependent<EnvironmentAndFacade> {
override fun get(key: DokkaSourceSet): EnvironmentAndFacade
operator fun get(sourceSetID: DokkaSourceSetID): EnvironmentAndFacade