diff options
5 files changed, 19 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", diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt index f9801c82..b1364004 100644 --- a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt +++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/BasicTest.kt @@ -11,6 +11,7 @@ class BasicTest : AbstractDokkaGradleTest() { val tmpRoot = testProjectDir.root.toPath() testDataRoot.resolve("src").copy(tmpRoot.resolve("src")) + testDataRoot.resolve("classDir").copy(tmpRoot.resolve("classDir")) testDataRoot.resolve("build.gradle").copy(tmpRoot.resolve("build.gradle")) testDataRoot.resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle")) } diff --git a/runners/gradle-integration-tests/testData/basic/build.gradle b/runners/gradle-integration-tests/testData/basic/build.gradle index bc20e1cf..4a259f50 100644 --- a/runners/gradle-integration-tests/testData/basic/build.gradle +++ b/runners/gradle-integration-tests/testData/basic/build.gradle @@ -36,4 +36,5 @@ dependencies { dokka { dokkaFatJar = new File(dokka_fatjar) + classpath += files("$projectDir/classDir") }
\ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/basic/fileTree.txt b/runners/gradle-integration-tests/testData/basic/fileTree.txt index 1a483d4e..2ceae371 100644 --- a/runners/gradle-integration-tests/testData/basic/fileTree.txt +++ b/runners/gradle-integration-tests/testData/basic/fileTree.txt @@ -22,6 +22,9 @@ constructor.html index.html main.html + p1.-my-binary-class/ + index.html + test.html str.html x.html index-outline.html diff --git a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt b/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt index 7492e2a8..3d7bcb51 100644 --- a/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt +++ b/runners/gradle-integration-tests/testData/basic/src/main/kotlin/demo/HelloWorld.kt @@ -1,5 +1,7 @@ package demo +import p1.MyBinaryClass + /** * This class supports greeting people by name. * @@ -39,3 +41,5 @@ fun SomeType.constructor(): SomeType { annotation class A(val p: String) +val MyBinaryClass.test get() = s() + |