aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-logic/build.gradle.kts4
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/conventions/gradle-plugin.gradle.kts9
-rw-r--r--build.gradle.kts1
-rw-r--r--gradle/libs.versions.toml12
-rw-r--r--integration-tests/gradle/projects/it-android-0/gradle.properties4
-rw-r--r--integration-tests/gradle/projects/it-wasm-basic/build.gradle.kts1
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt9
-rw-r--r--runners/gradle-plugin/build.gradle.kts5
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt6
-rw-r--r--runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt10
-rw-r--r--subprojects/analysis-kotlin-descriptors/build.gradle.kts5
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt72
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaJsResolverForModuleFactory.kt19
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaNativeResolverForModuleFactory.kt19
-rw-r--r--subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/translator/DefaultDescriptorToDocumentableTranslator.kt6
15 files changed, 103 insertions, 79 deletions
diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts
index 5272534d..efb2e4af 100644
--- a/build-logic/build.gradle.kts
+++ b/build-logic/build.gradle.kts
@@ -1,3 +1,5 @@
+import org.gradle.kotlin.dsl.support.expectedKotlinDslPluginsVersion
+
plugins {
`kotlin-dsl`
}
@@ -12,6 +14,8 @@ dependencies {
implementation(libs.gradlePlugin.dokka)
implementation(libs.gradlePlugin.kotlin)
implementation(libs.gradlePlugin.shadow)
+ implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:$expectedKotlinDslPluginsVersion")
+ implementation(libs.gradlePlugin.gradlePublish)
// workaround for accessing version-catalog in convention plugins
// https://github.com/gradle/gradle/issues/15383#issuecomment-779893192
diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/gradle-plugin.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/gradle-plugin.gradle.kts
new file mode 100644
index 00000000..0adaabaa
--- /dev/null
+++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/gradle-plugin.gradle.kts
@@ -0,0 +1,9 @@
+package org.jetbrains.conventions
+
+plugins {
+ id("org.gradle.kotlin.kotlin-dsl")
+ id("org.jetbrains.conventions.maven-publish")
+ id("com.gradle.plugin-publish")
+ id("org.jetbrains.conventions.base-java")
+ kotlin("jvm")
+}
diff --git a/build.gradle.kts b/build.gradle.kts
index d3b965bd..5aa0e1e1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,6 @@ plugins {
id("org.jetbrains.conventions.dokka")
alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
- alias(libs.plugins.gradlePublish) apply false // see #3031 for "apply false" reasoning
alias(libs.plugins.nexusPublish)
}
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 4f7f1772..a09f1413 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,20 +1,21 @@
[versions]
-gradlePlugin-kotlin = "1.8.20"
-gradlePlugin-android = "4.1.3"
+gradlePlugin-kotlin = "1.9.0"
+# See: https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin
+gradlePlugin-android = "4.2.2"
gradlePlugin-dokka = "1.8.20"
kotlinx-coroutines = "1.6.3"
kotlinx-bcv = "0.12.1"
## Analysis
-kotlin-compiler = "1.8.20"
+kotlin-compiler = "1.9.0"
# MUST match the version of the intellij platform used in the kotlin compiler,
# otherwise this will lead to different versions of psi API and implementations
# on the classpath and will fail with hard to debug problems in runtime.
# See: https://github.com/JetBrains/kotlin/blob/e6633d3d9214402fcf3585ae8c24213a4761cc8b/gradle/versions.properties#L1
-intellij-platform = "203.8084.24"
+intellij-platform = "213.7172.25"
## HTML
jsoup = "1.15.3"
@@ -62,6 +63,7 @@ gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ve
gradlePlugin-android = { module = "com.android.tools.build:gradle", version.ref = "gradlePlugin-android" }
gradlePlugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "gradlePlugin-dokka" }
gradlePlugin-shadow = { module = "gradle.plugin.com.github.johnrengelman:shadow", version.ref = "gradlePlugin-shadow" }
+gradlePlugin-gradlePublish= { module = "com.gradle.publish:plugin-publish-plugin", version.ref = "gradlePlugin-gradlePluginPublish" }
#### Kotlin analysis ####
kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "kotlin-compiler" }
@@ -109,7 +111,5 @@ junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" }
# and define the Maven coordinates above to be used in build-logic/build.gradle.kts)
kotlinx-binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinx-bcv" }
-shadow = { id = "com.github.johnrengelman.shadow", version.ref = "gradlePlugin-shadow" }
-gradlePublish = { id = "com.gradle.plugin-publish", version.ref = "gradlePlugin-gradlePluginPublish" }
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradlePlugin-nexusPublish" }
gradleNode = { id = "com.github.node-gradle.node", version.ref = "gradlePlugin-gradleNode" }
diff --git a/integration-tests/gradle/projects/it-android-0/gradle.properties b/integration-tests/gradle/projects/it-android-0/gradle.properties
index 9eda8eb7..4f97213e 100644
--- a/integration-tests/gradle/projects/it-android-0/gradle.properties
+++ b/integration-tests/gradle/projects/it-android-0/gradle.properties
@@ -1,3 +1,3 @@
-dokka_it_kotlin_version=1.8.20
-dokka_it_android_gradle_plugin_version=4.1.3
+dokka_it_kotlin_version=1.9.0
+dokka_it_android_gradle_plugin_version=4.2.2
android.useAndroidX=true
diff --git a/integration-tests/gradle/projects/it-wasm-basic/build.gradle.kts b/integration-tests/gradle/projects/it-wasm-basic/build.gradle.kts
index bab68c7f..bed3c9b1 100644
--- a/integration-tests/gradle/projects/it-wasm-basic/build.gradle.kts
+++ b/integration-tests/gradle/projects/it-wasm-basic/build.gradle.kts
@@ -14,6 +14,7 @@ repositories {
}
kotlin {
+ jvm() // artificial empty target to avoid single target project
wasm()
sourceSets {
val wasmMain by getting {
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt
index 0b56d6ef..eb39ef4f 100644
--- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt
@@ -2,7 +2,7 @@ package org.jetbrains.dokka.it.gradle
internal object TestedVersions {
- val LATEST = BuildVersions("7.4.2", "1.8.20")
+ val LATEST = BuildVersions("7.6.2", "1.9.0")
/**
* All supported Gradle/Kotlin versions, including [LATEST]
@@ -12,10 +12,10 @@ internal object TestedVersions {
val ALL_SUPPORTED =
BuildVersions.permutations(
gradleVersions = listOf("6.9"),
- kotlinVersions = listOf("1.7.20", "1.6.21", "1.5.31", "1.4.32"),
+ kotlinVersions = listOf("1.8.20", "1.7.20", "1.6.21", "1.5.31"),
) + BuildVersions.permutations(
gradleVersions = listOf(*ifExhaustive("7.0", "6.1.1")),
- kotlinVersions = listOf(*ifExhaustive("1.7.0", "1.6.0", "1.5.0", "1.4.0"))
+ kotlinVersions = listOf(*ifExhaustive( "1.8.0", "1.7.0", "1.6.0", "1.5.0"))
) + LATEST
/**
@@ -46,6 +46,7 @@ internal object TestedVersions {
"1.7.20" to "18.2.0-pre.391",
"1.8.0" to "18.2.0-pre.467",
"1.8.10" to "18.2.0-pre.490",
- "1.8.20" to "18.2.0-pre.546"
+ "1.8.20" to "18.2.0-pre.546",
+ "1.9.0" to "18.2.0-pre.597",
)
}
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts
index e5d64fe5..c7f34f55 100644
--- a/runners/gradle-plugin/build.gradle.kts
+++ b/runners/gradle-plugin/build.gradle.kts
@@ -1,10 +1,7 @@
import org.jetbrains.*
plugins {
- `kotlin-dsl`
- id("org.jetbrains.conventions.maven-publish")
- id("org.jetbrains.conventions.base-java")
- id("com.gradle.plugin-publish")
+ id("org.jetbrains.conventions.gradle-plugin")
}
dependencies {
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
index e05b2075..b534dcc4 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
@@ -55,8 +55,10 @@ private fun KotlinCompilation.classpathOf(project: Project): FileCollection {
val shouldKeepBackwardsCompatibility = (kgpVersion != null && kgpVersion < KotlinGradlePluginVersion(1, 7, 0))
return if (shouldKeepBackwardsCompatibility) {
- @Suppress("DEPRECATION_ERROR")
- kotlinCompile.classpath // deprecated with error since 1.8.0, left for compatibility with < Kotlin 1.7
+ // removed since 1.9.0, left for compatibility with < Kotlin 1.7
+ val classpathGetter= kotlinCompile::class.members
+ .first { it.name == "getClasspath" }
+ classpathGetter.call(kotlinCompile) as FileCollection
} else {
kotlinCompile.libraries // introduced in 1.7.0
}
diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
index 713109bf..88bef2b2 100644
--- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
+++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt
@@ -2,6 +2,7 @@ package org.jetbrains.dokka.gradle
import org.jetbrains.dokka.gradle.utils.withDependencies_
import org.gradle.api.artifacts.FileCollectionDependency
+import org.gradle.api.internal.project.DefaultProject
import org.gradle.kotlin.dsl.get
import org.gradle.testfixtures.ProjectBuilder
import org.jetbrains.dokka.gradle.kotlin.gistOf
@@ -163,6 +164,7 @@ class KotlinSourceSetGistTest {
kotlin.jvm()
kotlin.macosX64("macos")
+ (project as DefaultProject).evaluate()
val commonMainSourceSet = kotlin.sourceSets.getByName("commonMain")
val commonMainSourceSetGist = project.gistOf(commonMainSourceSet)
@@ -232,17 +234,11 @@ class KotlinSourceSetGistTest {
"Expected macosTest not being marked with 'isMain'"
)
+ // requires `project.evaluate()`
assertEquals(
setOf("commonMain"), jvmMainSourceSetGist.dependentSourceSetNames.get(),
"Expected jvmMain to depend on commonMain by default"
)
-
- /* Why not? */
- jvmMainSourceSet.dependsOn(macosMainSourceSet)
- assertEquals(
- setOf("commonMain", "macosMain"), jvmMainSourceSetGist.dependentSourceSetNames.get(),
- "Expected dependent source set changes to be reflected in gist"
- )
}
}
diff --git a/subprojects/analysis-kotlin-descriptors/build.gradle.kts b/subprojects/analysis-kotlin-descriptors/build.gradle.kts
index 3f028090..452bf7c6 100644
--- a/subprojects/analysis-kotlin-descriptors/build.gradle.kts
+++ b/subprojects/analysis-kotlin-descriptors/build.gradle.kts
@@ -8,6 +8,11 @@ plugins {
}
dependencies {
+ // to override some interfaces (JvmAnnotationEnumFieldValue, JvmAnnotationConstantValue) from compiler since thet are empty there
+ // should be `api` since we already have it in :analysis-java-psi
+ api(libs.intellij.java.psi.api) {
+ isTransitive = false
+ }
implementation(projects.subprojects.analysisKotlinApi)
implementation(projects.subprojects.analysisKotlinDescriptors.compiler)
implementation(projects.subprojects.analysisKotlinDescriptors.ide)
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
index ed9d887d..038a5ef7 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/AnalysisEnvironment.kt
@@ -343,23 +343,24 @@ class AnalysisEnvironment(
moduleInfo: ModuleInfo
): ResolverForModule =
CommonResolverForModuleFactory(
- CommonAnalysisParameters(
- metadataPartProviderFactory = { content ->
- environment.createPackagePartProvider(content.moduleContentScope)
- }
- ),
- CompilerEnvironment,
- unspecifiedJvmPlatform,
- true,
- dependencyContainer
- ).createResolverForModule(
+ CommonAnalysisParameters(
+ metadataPartProviderFactory = { content ->
+ environment.createPackagePartProvider(content.moduleContentScope)
+ }
+ ),
+ CompilerEnvironment,
+ unspecifiedJvmPlatform,
+ true,
+ dependencyContainer
+ ).createResolverForModule(
moduleDescriptor = descriptor as ModuleDescriptorImpl,
moduleContext = projectContext.withModule(descriptor),
moduleContent = modulesContent(moduleInfo),
resolverForProject = this,
languageVersionSettings = LanguageVersionSettingsImpl.DEFAULT,
sealedInheritorsProvider = CliSealedClassInheritorsProvider,
- resolveOptimizingOptions = null
+ resolveOptimizingOptions = null,
+ absentDescriptorHandlerClass = null
)
override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
@@ -387,7 +388,8 @@ class AnalysisEnvironment(
resolverForProject = this,
languageVersionSettings = LanguageVersionSettingsImpl.DEFAULT,
sealedInheritorsProvider = CliSealedClassInheritorsProvider,
- resolveOptimizingOptions = null
+ resolveOptimizingOptions = null,
+ absentDescriptorHandlerClass = null
)
override fun builtInsForModule(module: ModuleInfo): KotlinBuiltIns = DefaultBuiltIns.Instance
@@ -419,7 +421,8 @@ class AnalysisEnvironment(
resolverForProject = this,
languageVersionSettings = LanguageVersionSettingsImpl.DEFAULT,
sealedInheritorsProvider = CliSealedClassInheritorsProvider,
- resolveOptimizingOptions = null
+ resolveOptimizingOptions = null,
+ absentDescriptorHandlerClass = null
)
}
@@ -464,33 +467,34 @@ class AnalysisEnvironment(
descriptor: ModuleDescriptor,
moduleInfo: ModuleInfo
): ResolverForModule = JvmResolverForModuleFactory(
- JvmPlatformParameters(packagePartProviderFactory = { content ->
- JvmPackagePartProvider(
- configuration.languageVersionSettings,
- content.moduleContentScope
- )
- .apply {
- addRoots(javaRoots, messageCollector)
- }
- }, moduleByJavaClass = {
- val file =
- (it as? BinaryJavaClass)?.virtualFile ?: (it as JavaClassImpl).psi.containingFile.virtualFile
- if (file in sourcesScope)
- module
- else
- library
- }, resolverForReferencedModule = null,
- useBuiltinsProviderForModule = { false }),
- CompilerEnvironment,
- unspecifiedJvmPlatform
- ).createResolverForModule(
+ JvmPlatformParameters(packagePartProviderFactory = { content ->
+ JvmPackagePartProvider(
+ configuration.languageVersionSettings,
+ content.moduleContentScope
+ )
+ .apply {
+ addRoots(javaRoots, messageCollector)
+ }
+ }, moduleByJavaClass = {
+ val file =
+ (it as? BinaryJavaClass)?.virtualFile ?: (it as JavaClassImpl).psi.containingFile.virtualFile
+ if (file in sourcesScope)
+ module
+ else
+ library
+ }, resolverForReferencedModule = null,
+ useBuiltinsProviderForModule = { false }),
+ CompilerEnvironment,
+ unspecifiedJvmPlatform
+ ).createResolverForModule(
moduleDescriptor = descriptor as ModuleDescriptorImpl,
moduleContext = projectContext.withModule(descriptor),
moduleContent = modulesContent(moduleInfo),
resolverForProject = this,
languageVersionSettings = configuration.languageVersionSettings,
sealedInheritorsProvider = CliSealedClassInheritorsProvider,
- resolveOptimizingOptions = null
+ resolveOptimizingOptions = null,
+ absentDescriptorHandlerClass = null
)
override fun sdkDependency(module: ModuleInfo): ModuleInfo? = null
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaJsResolverForModuleFactory.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaJsResolverForModuleFactory.kt
index bb6148ad..c1965db2 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaJsResolverForModuleFactory.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaJsResolverForModuleFactory.kt
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.serialization.js.DynamicTypeDeserializer
import org.jetbrains.kotlin.serialization.js.KotlinJavascriptSerializationUtil
import org.jetbrains.kotlin.serialization.js.createKotlinJavascriptPackageFragmentProvider
import org.jetbrains.kotlin.library.metadata.impl.KlibMetadataModuleDescriptorFactoryImpl
+import org.jetbrains.kotlin.resolve.lazy.AbsentDescriptorHandler
import org.jetbrains.kotlin.resolve.scopes.optimization.OptimizingOptions
import org.jetbrains.kotlin.utils.KotlinJavascriptMetadataUtils
import java.io.File
@@ -50,7 +51,8 @@ internal class DokkaJsResolverForModuleFactory(
resolverForProject: ResolverForProject<M>,
languageVersionSettings: LanguageVersionSettings,
sealedInheritorsProvider: SealedClassInheritorsProvider,
- resolveOptimizingOptions: OptimizingOptions?
+ resolveOptimizingOptions: OptimizingOptions?,
+ absentDescriptorHandlerClass: Class<out AbsentDescriptorHandler>?
): ResolverForModule {
val declarationProviderFactory = DeclarationProviderFactoryService.createDeclarationProviderFactory(
moduleContext.project,
@@ -61,13 +63,14 @@ internal class DokkaJsResolverForModuleFactory(
)
val container = createContainerForLazyResolve(
- moduleContext,
- declarationProviderFactory,
- CodeAnalyzerInitializer.getInstance(moduleContext.project).createTrace(), // BindingTraceContext(/* allowSliceRewrite = */ true),
- moduleDescriptor.platform!!,
- JsPlatformAnalyzerServices,
- targetEnvironment,
- languageVersionSettings
+ moduleContext = moduleContext,
+ declarationProviderFactory = declarationProviderFactory,
+ bindingTrace = CodeAnalyzerInitializer.getInstance(moduleContext.project).createTrace(), // BindingTraceContext(/* allowSliceRewrite = */ true),
+ platform = moduleDescriptor.platform!!,
+ analyzerServices = JsPlatformAnalyzerServices,
+ targetEnvironment = targetEnvironment,
+ languageVersionSettings = languageVersionSettings,
+ absentDescriptorHandlerClass = absentDescriptorHandlerClass
)
var packageFragmentProvider = container.get<ResolveSession>().packageFragmentProvider
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaNativeResolverForModuleFactory.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaNativeResolverForModuleFactory.kt
index ff1eb491..00b2bd68 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaNativeResolverForModuleFactory.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/resolve/DokkaNativeResolverForModuleFactory.kt
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
import org.jetbrains.kotlin.resolve.SealedClassInheritorsProvider
import org.jetbrains.kotlin.resolve.TargetEnvironment
import org.jetbrains.kotlin.resolve.konan.platform.NativePlatformAnalyzerServices
+import org.jetbrains.kotlin.resolve.lazy.AbsentDescriptorHandler
import org.jetbrains.kotlin.resolve.lazy.ResolveSession
import org.jetbrains.kotlin.resolve.lazy.declarations.DeclarationProviderFactoryService
import org.jetbrains.kotlin.resolve.scopes.optimization.OptimizingOptions
@@ -36,7 +37,8 @@ internal class DokkaNativeResolverForModuleFactory(
resolverForProject: ResolverForProject<M>,
languageVersionSettings: LanguageVersionSettings,
sealedInheritorsProvider: SealedClassInheritorsProvider,
- resolveOptimizingOptions: OptimizingOptions?
+ resolveOptimizingOptions: OptimizingOptions?,
+ absentDescriptorHandlerClass: Class<out AbsentDescriptorHandler>?
): ResolverForModule {
val declarationProviderFactory = DeclarationProviderFactoryService.createDeclarationProviderFactory(
@@ -48,13 +50,14 @@ internal class DokkaNativeResolverForModuleFactory(
)
val container = createContainerForLazyResolve(
- moduleContext,
- declarationProviderFactory,
- CodeAnalyzerInitializer.getInstance(moduleContext.project).createTrace(),
- moduleDescriptor.platform!!,
- NativePlatformAnalyzerServices,
- targetEnvironment,
- languageVersionSettings
+ moduleContext = moduleContext,
+ declarationProviderFactory = declarationProviderFactory,
+ bindingTrace = CodeAnalyzerInitializer.getInstance(moduleContext.project).createTrace(),
+ platform = moduleDescriptor.platform!!,
+ analyzerServices = NativePlatformAnalyzerServices,
+ targetEnvironment = targetEnvironment,
+ languageVersionSettings = languageVersionSettings,
+ absentDescriptorHandlerClass = absentDescriptorHandlerClass
)
var packageFragmentProvider = container.get<ResolveSession>().packageFragmentProvider
diff --git a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/translator/DefaultDescriptorToDocumentableTranslator.kt b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/translator/DefaultDescriptorToDocumentableTranslator.kt
index cb52236e..08313503 100644
--- a/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/translator/DefaultDescriptorToDocumentableTranslator.kt
+++ b/subprojects/analysis-kotlin-descriptors/compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/translator/DefaultDescriptorToDocumentableTranslator.kt
@@ -1149,14 +1149,14 @@ private class DokkaDescriptorVisitor(
fullEnumEntryName(),
DRI(enumClassId.packageFqName.asString(), fullEnumEntryName())
)
- is ConstantsKtClassValue -> when (value) {
- is NormalClass -> (value as NormalClass).value.classId.let {
+ is ConstantsKtClassValue -> when (val value = value) {
+ is NormalClass -> value.classId.let {
ClassValue(
it.relativeClassName.asString(),
DRI(it.packageFqName.asString(), it.relativeClassName.asString())
)
}
- is LocalClass -> (value as LocalClass).type.let {
+ is LocalClass -> value.type.let {
ClassValue(
it.toString(),
DRI.from(it.constructor.declarationDescriptor as DeclarationDescriptor)