aboutsummaryrefslogtreecommitdiff
path: root/src/AnalysesEnvironment.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:49:04 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-11 20:49:04 +0400
commit044308ba60a0d4462ccb7388f16ad17a31d7450d (patch)
treec93411f0670e29fe333962789c0df97b1602f7be /src/AnalysesEnvironment.kt
parent8a4dad46b171c55dabc5f9be29e1261e1cc5928e (diff)
downloaddokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.gz
dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.tar.bz2
dokka-044308ba60a0d4462ccb7388f16ad17a31d7450d.zip
Complete package migration and move files into folders.
Diffstat (limited to 'src/AnalysesEnvironment.kt')
-rw-r--r--src/AnalysesEnvironment.kt71
1 files changed, 0 insertions, 71 deletions
diff --git a/src/AnalysesEnvironment.kt b/src/AnalysesEnvironment.kt
deleted file mode 100644
index 7cd95feb..00000000
--- a/src/AnalysesEnvironment.kt
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.jetbrains.dokka
-
-import com.intellij.openapi.*
-import org.jetbrains.jet.cli.common.messages.*
-import org.jetbrains.jet.cli.common.*
-import org.jetbrains.jet.cli.jvm.compiler.*
-import java.io.*
-import org.jetbrains.jet.cli.jvm.*
-import org.jetbrains.jet.config.*
-import com.intellij.openapi.util.*
-import org.jetbrains.jet.lang.resolve.*
-import org.jetbrains.jet.lang.psi.*
-import kotlin.platform.*
-
-public class AnalysesEnvironment(val messageCollector: MessageCollector, body: AnalysesEnvironment.() -> Unit = {}) : Disposable {
- val configuration = CompilerConfiguration();
-
- {
- configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector)
- body()
- }
-
- private fun withContext<T>(processor: (JetCoreEnvironment, BindingContext) -> T): T {
- val environment = JetCoreEnvironment.createForProduction(this, configuration)
- val result = environment.analyze(messageCollector)
- return processor(environment, result)
- }
-
- public fun withContext<T>(processor: (BindingContext) -> T): T {
- return withContext { environment, context -> processor(context) }
- }
-
- public fun streamFiles<T>(processor: (BindingContext, JetFile) -> T): Stream<T> {
- return withContext { environment, context ->
- environment.getSourceFiles().stream().map { file -> processor(context, file) }
- }
- }
-
- public fun processFiles<T>(processor: (BindingContext, JetFile) -> T): List<T> {
- return withContext { environment, context ->
- environment.getSourceFiles().map { file -> processor(context, file) }
- }
- }
-
- public fun processFilesFlat<T>(processor: (BindingContext, JetFile) -> List<T>): List<T> {
- return withContext { environment, context ->
- environment.getSourceFiles().flatMap { file -> processor(context, file) }
- }
- }
-
- public val classpath: List<File>
- get() = configuration.get(JVMConfigurationKeys.CLASSPATH_KEY) ?: listOf()
-
- public fun addClasspath(list: List<File>) {
- configuration.addAll(JVMConfigurationKeys.CLASSPATH_KEY, list)
- }
-
- public fun addClasspath(file: File) {
- configuration.add(JVMConfigurationKeys.CLASSPATH_KEY, file)
- }
-
- public val sources: List<String>
- get() = configuration.get(CommonConfigurationKeys.SOURCE_ROOTS_KEY) ?: listOf()
- public fun addSources(list: List<String>) {
- configuration.addAll(CommonConfigurationKeys.SOURCE_ROOTS_KEY, list)
- }
-
- public override fun dispose() {
- Disposer.dispose(this)
- }
-} \ No newline at end of file