diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt index 1ac840bd657..2841ed056df 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.kt @@ -33,6 +33,13 @@ class K2JSCompilerArguments : CommonCompilerArguments() { ) var libraries: String? by NullableStringFreezableVar(null) + @Argument( + value = "-Xrepositories", + valueDescription = "", + description = "Paths to additional places where libraries could be found" + ) + var repositries: String? by NullableStringFreezableVar(null) + @GradleOption(DefaultValues.BooleanFalseDefault::class) @Argument(value = "-source-map", description = "Generate source map") var sourceMap: Boolean by FreezableVar(false) diff --git a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JsIrCompiler.kt b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JsIrCompiler.kt index ac0653c9598..7c3cb426ade 100644 --- a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JsIrCompiler.kt +++ b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/K2JsIrCompiler.kt @@ -113,9 +113,11 @@ class K2JsIrCompiler : CLICompiler() { val libraries: List = configureLibraries(arguments.libraries) + listOfNotNull(arguments.includes) val friendLibraries: List = configureLibraries(arguments.friendModules) + val repositories: List = configureLibraries(arguments.repositries) configuration.put(JSConfigurationKeys.LIBRARIES, libraries) configuration.put(JSConfigurationKeys.TRANSITIVE_LIBRARIES, libraries) + configuration.put(JSConfigurationKeys.REPOSITORIES, repositories) val commonSourcesArray = arguments.commonSources val commonSources = commonSourcesArray?.toSet() ?: emptySet() diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 63f9b4b89f7..e53c25cb0d9 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -21,6 +21,7 @@ where advanced options include: -Xir-property-lazy-initialization Perform lazy initialization for properties -Xmetadata-only Generate *.meta.js and *.kjsm files only + -Xrepositories= Paths to additional places where libraries could be found -Xtyped-arrays Translate primitive arrays to JS typed arrays -Xwasm Use experimental WebAssembly compiler backend -Xallow-kotlin-package Allow compiling code in package 'kotlin' and allow not requiring kotlin.stdlib in module-info