aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--plugins/base/src/main/kotlin/DokkaBase.kt2
3 files changed, 13 insertions, 7 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
diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt
index fcea6be9..bc2827ac 100644
--- a/plugins/base/src/main/kotlin/DokkaBase.kt
+++ b/plugins/base/src/main/kotlin/DokkaBase.kt
@@ -152,7 +152,7 @@ class DokkaBase : DokkaPlugin() {
val defaultKotlinAnalysis by extending {
- kotlinAnalysis providing { ctx -> KotlinAnalysis(ctx) }
+ kotlinAnalysis providing { ctx -> KotlinAnalysis(ctx.configuration.sourceSets, ctx.logger) }
}
val locationProvider by extending {