diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-13 23:22:05 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-13 23:22:05 +0300 |
commit | d552647b6a51241aa5d5e9e50b87e22564c069e7 (patch) | |
tree | 91914bef1a6bf20ac3e6ea85aba02c2b22b488f5 /core/src/main | |
parent | 7485016705c4364dcea0212b5bc816f326ad7a87 (diff) | |
download | dokka-d552647b6a51241aa5d5e9e50b87e22564c069e7.tar.gz dokka-d552647b6a51241aa5d5e9e50b87e22564c069e7.tar.bz2 dokka-d552647b6a51241aa5d5e9e50b87e22564c069e7.zip |
Fix adding class directories to classpath Fixes #252
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/kotlin/Analysis/AnalysisEnvironment.kt | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt index 003c6835..3b9b9149 100644 --- a/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt +++ b/core/src/main/kotlin/Analysis/AnalysisEnvironment.kt @@ -13,7 +13,6 @@ import com.intellij.openapi.roots.ProjectFileIndex import com.intellij.openapi.roots.ProjectRootManager import com.intellij.openapi.util.Disposer import com.intellij.openapi.vfs.StandardFileSystems -import com.intellij.openapi.vfs.VirtualFileManager import com.intellij.psi.PsiElement import com.intellij.psi.search.GlobalSearchScope import com.intellij.util.io.URLUtil @@ -114,11 +113,17 @@ class AnalysisEnvironment(val messageCollector: MessageCollector) : Disposable { val builtIns = JvmBuiltIns(projectContext.storageManager) - val javaRoots = run { - val jvfs = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JAR_PROTOCOL) + val javaRoots = classpath + .map { + val rootFile = when { + it.extension == "jar" -> + StandardFileSystems.jar().findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}")!! + else -> + StandardFileSystems.local().findFileByPath(it.absolutePath)!! + } - classpath.map { JavaRoot(jvfs.findFileByPath("${it.absolutePath}${URLUtil.JAR_SEPARATOR}")!!, JavaRoot.RootType.BINARY) } - } + JavaRoot(rootFile, JavaRoot.RootType.BINARY) + } val resolverForProject = ResolverForProjectImpl( "Dokka", |