diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-13 14:37:50 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2016-01-13 14:37:50 +0100 |
commit | 5ed4d2e511f96bc2f949228ee1ddc9dacf28c2a2 (patch) | |
tree | 1a12fc6404e87b0249b411626e282ed91c9f2717 /core/src | |
parent | 6cccf161648881e7285694a6b0893b73abbde9fb (diff) | |
download | dokka-5ed4d2e511f96bc2f949228ee1ddc9dacf28c2a2.tar.gz dokka-5ed4d2e511f96bc2f949228ee1ddc9dacf28c2a2.tar.bz2 dokka-5ed4d2e511f96bc2f949228ee1ddc9dacf28c2a2.zip |
add all source roots as both Java and Kotlin source roots. Resolves #39
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/Analysis/AnalysisEnvironment.kt | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index b0c39ee5..82a2eb2a 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -22,14 +22,8 @@ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment -import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot -import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot -import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoots -import org.jetbrains.kotlin.cli.jvm.config.jvmClasspathRoots -import org.jetbrains.kotlin.config.CommonConfigurationKeys -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.ContentRoot -import org.jetbrains.kotlin.config.KotlinSourceRoot +import org.jetbrains.kotlin.cli.jvm.config.* +import org.jetbrains.kotlin.config.* import org.jetbrains.kotlin.container.getService import org.jetbrains.kotlin.context.ProjectContext import org.jetbrains.kotlin.descriptors.DeclarationDescriptor @@ -152,7 +146,11 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { */ fun addSources(list: List<String>) { list.forEach { - configuration.add(CommonConfigurationKeys.CONTENT_ROOTS, contentRootFromPath(it)) + configuration.addKotlinSourceRoot(it) + val file = File(it) + if (file.isDirectory || file.extension == ".java") { + configuration.addJavaSourceRoot(file) + } } } |