Skip to content

Commit

Permalink
Fix setup of JS deps in AnalysisEnvironment
Browse files Browse the repository at this point in the history
  • Loading branch information
vmishenev committed Dec 5, 2021
1 parent ba4ed92 commit 8b97c9b
Showing 1 changed file with 7 additions and 4 deletions.
Expand Up @@ -310,7 +310,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
else DokkaJsKlibLibraryInfo(kotlinLibrary, analyzerServices, dependencyResolver)
)
}
} catch (e: kotlin.Throwable) {
} catch (e: Throwable) {
configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY)
.report(CompilerMessageSeverity.WARNING, "Can not resolve KLIB. " + e.message)
}
Expand Down Expand Up @@ -496,7 +496,8 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
* Classpath for this environment.
*/
val classpath: List<File>
get() = configuration.jvmClasspathRoots
get() = configuration.jvmClasspathRoots + configuration.getList(JSConfigurationKeys.LIBRARIES)
.mapNotNull { File(it) }

/**
* Adds list of paths to classpath.
Expand All @@ -505,8 +506,9 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
fun addClasspath(paths: List<File>) {
if (analysisPlatform == Platform.js) {
configuration.addAll(JSConfigurationKeys.LIBRARIES, paths.map { it.absolutePath })
} else {
configuration.addJvmClasspathRoots(paths)
}
configuration.addJvmClasspathRoots(paths)
}

/**
Expand All @@ -516,8 +518,9 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl
fun addClasspath(path: File) {
if (analysisPlatform == Platform.js) {
configuration.add(JSConfigurationKeys.LIBRARIES, path.absolutePath)
} else {
configuration.addJvmClasspathRoot(path)
}
configuration.addJvmClasspathRoot(path)
}

/**
Expand Down

0 comments on commit 8b97c9b

Please sign in to comment.