diff options
author | Igor Yakovlev <igor.yakovlev@jetbrains.com> | 2023-01-25 19:03:21 +0100 |
---|---|---|
committer | igoriakovlev <54274820+igoriakovlev@users.noreply.github.com> | 2023-01-26 15:03:04 +0100 |
commit | 7a680acb011e38c66e2039cd5d831a49b16546ad (patch) | |
tree | 1e6c410868c474b58eeb996a67ef3f0a9fbbc237 /kotlin-analysis/src/main/kotlin/org | |
parent | adfeed1b35b94ced80aba4e13dc926b2c389efb1 (diff) | |
download | dokka-7a680acb011e38c66e2039cd5d831a49b16546ad.tar.gz dokka-7a680acb011e38c66e2039cd5d831a49b16546ad.tar.bz2 dokka-7a680acb011e38c66e2039cd5d831a49b16546ad.zip |
Support kotlin wasm target
Diffstat (limited to 'kotlin-analysis/src/main/kotlin/org')
-rw-r--r-- | kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt | 16 |
1 files changed, 8 insertions, 8 deletions
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 0cae4e89..bbc6dda6 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 @@ -101,7 +101,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl val configFiles = when (analysisPlatform) { Platform.jvm, Platform.common -> EnvironmentConfigFiles.JVM_CONFIG_FILES Platform.native -> EnvironmentConfigFiles.NATIVE_CONFIG_FILES - Platform.js -> EnvironmentConfigFiles.JS_CONFIG_FILES + Platform.js, Platform.wasm -> EnvironmentConfigFiles.JS_CONFIG_FILES } val environment = KotlinCoreEnvironment.createForProduction(this, configuration, configFiles) @@ -170,7 +170,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl private fun createSourceModuleSearchScope(project: Project, sourceFiles: List<KtFile>): GlobalSearchScope = when (analysisPlatform) { Platform.jvm -> TopDownAnalyzerFacadeForJVM.newModuleSearchScope(project, sourceFiles) - Platform.js, Platform.common, Platform.native -> GlobalSearchScope.filesScope( + Platform.js, Platform.common, Platform.native, Platform.wasm -> GlobalSearchScope.filesScope( project, sourceFiles.map { it.virtualFile }.toSet() ) @@ -181,7 +181,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl val sourceFiles = environment.getSourceFiles() val targetPlatform = when (analysisPlatform) { - Platform.js -> JsPlatforms.defaultJsPlatform + Platform.js, Platform.wasm -> JsPlatforms.defaultJsPlatform Platform.common -> CommonPlatforms.defaultCommonPlatform Platform.native -> NativePlatforms.unspecifiedNativePlatform Platform.jvm -> JvmPlatforms.defaultJvmPlatform @@ -265,7 +265,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl environment, commonDependencyContainer ) - Platform.js -> createJsResolverForProject(projectContext, module, modulesContent) + Platform.js, Platform.wasm -> createJsResolverForProject(projectContext, module, modulesContent) Platform.native -> createNativeResolverForProject(projectContext, module, modulesContent) } @@ -299,14 +299,14 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl } private fun Platform.analyzerServices() = when (this) { - Platform.js -> JsPlatformAnalyzerServices + Platform.js, Platform.wasm -> JsPlatformAnalyzerServices Platform.common -> CommonPlatformAnalyzerServices Platform.native -> NativePlatformAnalyzerServices Platform.jvm -> JvmPlatformAnalyzerServices } fun Collection<KotlinLibrary>.registerLibraries(): List<DokkaKlibLibraryInfo> { - if (analysisPlatform != Platform.native && analysisPlatform != Platform.js) return emptyList() + if (analysisPlatform != Platform.native && analysisPlatform != Platform.js && analysisPlatform != Platform.wasm) return emptyList() val dependencyResolver = DokkaKlibLibraryDependencyResolver() val analyzerServices = analysisPlatform.analyzerServices() @@ -543,7 +543,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl * $paths: collection of files to add */ fun addClasspath(paths: List<File>) { - if (analysisPlatform == Platform.js) { + if (analysisPlatform == Platform.js || analysisPlatform == Platform.wasm) { configuration.addAll(JSConfigurationKeys.LIBRARIES, paths.map { it.absolutePath }) } else { configuration.addJvmClasspathRoots(paths) @@ -557,7 +557,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl * $path: path to add */ fun addClasspath(path: File) { - if (analysisPlatform == Platform.js) { + if (analysisPlatform == Platform.js || analysisPlatform == Platform.wasm) { configuration.add(JSConfigurationKeys.LIBRARIES, path.absolutePath) } else { configuration.addJvmClasspathRoot(path) |