aboutsummaryrefslogtreecommitdiff
path: root/kotlin-analysis
diff options
context:
space:
mode:
Diffstat (limited to 'kotlin-analysis')
-rw-r--r--kotlin-analysis/build.gradle.kts6
-rw-r--r--kotlin-analysis/compiler-dependency/build.gradle.kts28
-rw-r--r--kotlin-analysis/intellij-dependency/build.gradle.kts (renamed from kotlin-analysis/dependencies/build.gradle.kts)10
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt12
-rw-r--r--kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt36
5 files changed, 76 insertions, 16 deletions
diff --git a/kotlin-analysis/build.gradle.kts b/kotlin-analysis/build.gradle.kts
index 8458ecc4..9f1588f3 100644
--- a/kotlin-analysis/build.gradle.kts
+++ b/kotlin-analysis/build.gradle.kts
@@ -8,10 +8,8 @@ plugins {
dependencies {
compileOnly(project(":core"))
-
- val kotlin_version: String by project
- api("org.jetbrains.kotlin:kotlin-compiler:$kotlin_version")
- api(project(":kotlin-analysis:dependencies", configuration = "shadow"))
+ api(project("intellij-dependency", configuration = "shadow"))
+ api(project("compiler-dependency", configuration = "shadow"))
}
registerDokkaArtifactPublication("dokkaAnalysis") {
diff --git a/kotlin-analysis/compiler-dependency/build.gradle.kts b/kotlin-analysis/compiler-dependency/build.gradle.kts
new file mode 100644
index 00000000..4d099a70
--- /dev/null
+++ b/kotlin-analysis/compiler-dependency/build.gradle.kts
@@ -0,0 +1,28 @@
+import org.jetbrains.DokkaPublicationBuilder.Component.Shadow
+import org.jetbrains.registerDokkaArtifactPublication
+
+plugins {
+ id("com.github.johnrengelman.shadow")
+ `maven-publish`
+ id("com.jfrog.bintray")
+}
+
+dependencies {
+ val kotlin_version: String by project
+ api("org.jetbrains.kotlin:kotlin-compiler:$kotlin_version")
+
+}
+
+tasks {
+ shadowJar {
+ val dokka_version: String by project
+ archiveFileName.set("dokka-kotlin-analysis-compiler-$dokka_version.jar")
+ archiveClassifier.set("")
+ exclude("**/intellij**")
+ }
+}
+
+registerDokkaArtifactPublication("kotlinAnalysisCompiler") {
+ artifactId = "kotlin-analysis-compiler"
+ component = Shadow
+}
diff --git a/kotlin-analysis/dependencies/build.gradle.kts b/kotlin-analysis/intellij-dependency/build.gradle.kts
index a12e697d..4ff68e4e 100644
--- a/kotlin-analysis/dependencies/build.gradle.kts
+++ b/kotlin-analysis/intellij-dependency/build.gradle.kts
@@ -30,12 +30,16 @@ dependencies {
val idea_version: String by project
intellijCore("com.jetbrains.intellij.idea:intellij-core:$idea_version")
implementation(intellijCoreAnalysis())
+
+ val kotlin_version: String by project
+ api("org.jetbrains.kotlin:kotlin-compiler:$kotlin_version")
+
}
tasks {
shadowJar {
val dokka_version: String by project
- archiveFileName.set("dokka-kotlin-analysis-dependencies-$dokka_version.jar")
+ archiveFileName.set("dokka-kotlin-analysis-intellij-$dokka_version.jar")
archiveClassifier.set("")
exclude("colorScheme/**")
@@ -50,7 +54,7 @@ tasks {
}
}
-registerDokkaArtifactPublication("kotlinAnalysisDependencies"){
- artifactId = "kotlin-analysis-dependencies"
+registerDokkaArtifactPublication("kotlinAnalysisIntelliJ") {
+ artifactId = "kotlin-analysis-intellij"
component = Shadow
}
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt
index c8b324a0..e70be408 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt
@@ -285,12 +285,11 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
Platform.common -> createCommonResolverForProject(
projectContext,
module,
- library,
modulesContent,
environment
)
- Platform.js -> createJsResolverForProject(projectContext, module, library, modulesContent)
- Platform.native -> createNativeResolverForProject(projectContext, module, library, modulesContent)
+ Platform.js -> createJsResolverForProject(projectContext, module, modulesContent)
+ Platform.native -> createNativeResolverForProject(projectContext, module, modulesContent)
}
val libraryModuleDescriptor = resolverForProject.descriptorForModule(library)
@@ -355,14 +354,13 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
private fun createCommonResolverForProject(
projectContext: ProjectContext,
module: ModuleInfo,
- library: LibraryModuleInfo,
modulesContent: (ModuleInfo) -> ModuleContent<ModuleInfo>,
environment: KotlinCoreEnvironment
): ResolverForProject<ModuleInfo> {
return object : AbstractResolverForProject<ModuleInfo>(
"Dokka",
projectContext,
- modules = listOf(module, library)
+ modules = module.dependencies()
) {
override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
@@ -394,13 +392,12 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
private fun createJsResolverForProject(
projectContext: ProjectContext,
module: ModuleInfo,
- library: LibraryModuleInfo,
modulesContent: (ModuleInfo) -> ModuleContent<ModuleInfo>
): ResolverForProject<ModuleInfo> {
return object : AbstractResolverForProject<ModuleInfo>(
"Dokka",
projectContext,
- modules = listOf(module, library)
+ modules = module.dependencies()
) {
override fun modulesContent(module: ModuleInfo): ModuleContent<ModuleInfo> = modulesContent(module)
override fun createResolverForModule(
@@ -425,7 +422,6 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
private fun createNativeResolverForProject(
projectContext: ProjectContext,
module: ModuleInfo,
- library: LibraryModuleInfo,
modulesContent: (ModuleInfo) -> ModuleContent<ModuleInfo>
): ResolverForProject<ModuleInfo> {
return object : AbstractResolverForProject<ModuleInfo>(
diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
index d0e0bb4f..346a305e 100644
--- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
+++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CoreProjectFileIndex.kt
@@ -1,7 +1,6 @@
package org.jetbrains.dokka.analysis
import com.intellij.openapi.Disposable
-import com.intellij.openapi.components.BaseComponent
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
@@ -54,6 +53,17 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
}
override fun getName(): String = "<Dokka module>"
+ override fun isLoaded(): Boolean {
+ throw UnsupportedOperationException()
+ }
+
+ override fun setOption(p0: String, p1: String?) {
+ throw UnsupportedOperationException()
+ }
+
+ override fun getOptionValue(p0: String): String? {
+ throw UnsupportedOperationException()
+ }
override fun getModuleWithLibrariesScope(): GlobalSearchScope {
throw UnsupportedOperationException()
@@ -67,6 +77,14 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
throw UnsupportedOperationException()
}
+ override fun getModuleContentScope(): GlobalSearchScope {
+ throw UnsupportedOperationException()
+ }
+
+ override fun getModuleContentWithDependenciesScope(): GlobalSearchScope {
+ throw UnsupportedOperationException()
+ }
+
override fun getModuleWithDependenciesAndLibrariesScope(p0: Boolean): GlobalSearchScope {
throw UnsupportedOperationException()
}
@@ -79,6 +97,10 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
throw UnsupportedOperationException()
}
+ override fun getModuleScope(p0: Boolean): GlobalSearchScope {
+ throw UnsupportedOperationException()
+ }
+
override fun getModuleRuntimeScope(p0: Boolean): GlobalSearchScope {
throw UnsupportedOperationException()
}
@@ -98,6 +120,18 @@ class CoreProjectFileIndex(private val project: Project, contentRoots: List<Cont
throw UnsupportedOperationException()
}
+ override fun getModuleFile(): VirtualFile? {
+ throw UnsupportedOperationException()
+ }
+
+ override fun getModuleFilePath(): String {
+ throw UnsupportedOperationException()
+ }
+
+ override fun getProject(): Project {
+ throw UnsupportedOperationException()
+ }
+
override fun getPicoContainer(): PicoContainer {
throw UnsupportedOperationException()
}