aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authoraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:32:19 +0300
committeraleksZubakov <aleks.zubakov@gmail.com>2018-07-12 15:32:19 +0300
commit65b61e31b761071589e257381bea33557d932412 (patch)
tree72f6da0574d2c2d7a3920c1c912b2de132d2e60a /core
parent9ea429920e07c77e1241c4beb172bb36735af783 (diff)
downloaddokka-65b61e31b761071589e257381bea33557d932412.tar.gz
dokka-65b61e31b761071589e257381bea33557d932412.tar.bz2
dokka-65b61e31b761071589e257381bea33557d932412.zip
AnalysisEnvironment classpath for js platform fix
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/Analysis/AnalysisEnvironment.kt21
1 files changed, 11 insertions, 10 deletions
diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
index 453c0311..27881cad 100644
--- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
+++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt
@@ -102,14 +102,15 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
return environment
}
- fun createSourceModuleSearchScope(project: Project, sourceFiles: List<KtFile>): GlobalSearchScope = when (analysisPlatform) {
- Platform.js -> GlobalSearchScope.filesScope(project, sourceFiles.map { it.virtualFile }.toSet())
+ fun createSourceModuleSearchScope(project: Project, sourceFiles: List<KtFile>): GlobalSearchScope =
+ when (analysisPlatform) {
Platform.jvm -> TopDownAnalyzerFacadeForJVM.newModuleSearchScope(project, sourceFiles)
- }
+ Platform.js -> GlobalSearchScope.filesScope(project, sourceFiles.map { it.virtualFile }.toSet())
+ }
fun createResolutionFacade(environment: KotlinCoreEnvironment): DokkaResolutionFacade {
- return when(analysisPlatform) {
+ return when (analysisPlatform) {
Platform.jvm -> createJVMResolutionFacade(environment)
Platform.js -> createJSResolutionFacade(environment)
}
@@ -255,10 +256,10 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
* $paths: collection of files to add
*/
fun addClasspath(paths: List<File>) {
- when (analysisPlatform) {
- Platform.js -> configuration.addAll(JSConfigurationKeys.LIBRARIES, paths.map{it.absolutePath})
- Platform.jvm -> configuration.addJvmClasspathRoots(paths)
+ if (analysisPlatform == Platform.js) {
+ configuration.addAll(JSConfigurationKeys.LIBRARIES, paths.map { it.absolutePath })
}
+ configuration.addJvmClasspathRoots(paths)
}
/**
@@ -266,10 +267,10 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
* $path: path to add
*/
fun addClasspath(path: File) {
- when (analysisPlatform) {
- Platform.js -> configuration.add(JSConfigurationKeys.LIBRARIES, path.absolutePath)
- Platform.jvm -> configuration.addJvmClasspathRoot(path)
+ if (analysisPlatform == Platform.js) {
+ configuration.add(JSConfigurationKeys.LIBRARIES, path.absolutePath)
}
+ configuration.addJvmClasspathRoot(path)
}
/**