[JS IR] Support additional repositories in CLI (compiler part)
This commit is contained in:
@@ -134,7 +134,7 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
|
||||
val resolvedLibraries = jsResolveLibraries(
|
||||
dependencies, messageCollectorLogger(MessageCollector.NONE)
|
||||
dependencies, emptyList(), messageCollectorLogger(MessageCollector.NONE)
|
||||
)
|
||||
|
||||
buildKLib(moduleName, listOfKtFilesFrom(inputFiles), outputPath, resolvedLibraries, listOfKtFilesFrom(commonSources))
|
||||
|
||||
@@ -175,6 +175,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
|
||||
val resolvedLibraries = jsResolveLibraries(
|
||||
libraries,
|
||||
configuration[JSConfigurationKeys.REPOSITORIES] ?: emptyList(),
|
||||
messageCollectorLogger(configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY] ?: error("Could not find message collector"))
|
||||
)
|
||||
|
||||
|
||||
+2
-2
@@ -37,12 +37,12 @@ class JsLibraryResolver(
|
||||
}
|
||||
|
||||
// TODO: This is a temporary set of library resolver policies for js compiler.
|
||||
fun jsResolveLibraries(libraries: List<String>, logger: Logger): KotlinLibraryResolveResult {
|
||||
fun jsResolveLibraries(libraries: List<String>, repositories: Collection<String>, logger: Logger): KotlinLibraryResolveResult {
|
||||
val unresolvedLibraries = libraries.map { UnresolvedLibrary(it, null) }
|
||||
val libraryAbsolutePaths = libraries.map { File(it).absolutePath }
|
||||
// Configure the resolver to only work with absolute paths for now.
|
||||
val libraryResolver = JsLibraryResolver(
|
||||
repositories = emptyList(),
|
||||
repositories = repositories.toList(),
|
||||
directLibs = libraryAbsolutePaths,
|
||||
distributionKlib = null,
|
||||
localKotlinDir = null,
|
||||
|
||||
Reference in New Issue
Block a user