JS: rename "-library-files" argument to "-libraries" and change separator
Use the system separator (':' or ';') instead of commas
#KT-16083 Fixed
This commit is contained in:
@@ -22,7 +22,7 @@ import java.io.File
|
||||
class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
override val compilerFqName = "org.jetbrains.kotlin.cli.js.K2JSCompiler"
|
||||
|
||||
var library: Path? = null
|
||||
var libraries: Path? = null
|
||||
var outputPrefix: File? = null
|
||||
var outputPostfix: File? = null
|
||||
var sourceMap: Boolean = false
|
||||
@@ -35,15 +35,9 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
*/
|
||||
var main: String? = null
|
||||
|
||||
fun createLibrary(): Path {
|
||||
val libraryPath = library
|
||||
if (libraryPath == null) {
|
||||
val t = Path(getProject())
|
||||
library = t
|
||||
return t
|
||||
}
|
||||
|
||||
return libraryPath.createPath()
|
||||
fun createLibraries(): Path {
|
||||
val libraryPaths = libraries ?: return Path(getProject()).also { libraries = it }
|
||||
return libraryPaths.createPath()
|
||||
}
|
||||
|
||||
override fun fillSpecificArguments() {
|
||||
@@ -51,9 +45,9 @@ class Kotlin2JsTask : KotlinCompilerBaseTask() {
|
||||
args.add(output!!.canonicalPath)
|
||||
|
||||
// TODO: write test
|
||||
library?.let {
|
||||
args.add("-library-files")
|
||||
args.add(it.list().joinToString(separator = ",") { File(it).canonicalPath })
|
||||
libraries?.let {
|
||||
args.add("-libraries")
|
||||
args.add(it.list().joinToString(File.pathSeparator) { File(it).canonicalPath })
|
||||
}
|
||||
|
||||
outputPrefix?.let {
|
||||
|
||||
+3
-3
@@ -35,9 +35,9 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
@Argument(value = "no-stdlib", description = "Don't use bundled Kotlin stdlib")
|
||||
public boolean noStdlib;
|
||||
|
||||
@Argument(value = "library-files", description = "Path to zipped library sources or kotlin files separated by commas")
|
||||
@ValueDescription("<path[,]>")
|
||||
public String[] libraryFiles;
|
||||
@Argument(value = "libraries", description = "Paths to Kotlin libraries with .meta.js and .kjsm files, separated by system file separator")
|
||||
@ValueDescription("<path>")
|
||||
public String libraries;
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@Argument(value = "source-map", description = "Generate source map")
|
||||
|
||||
@@ -58,8 +58,8 @@ import org.jetbrains.kotlin.js.facade.MainCallParameters;
|
||||
import org.jetbrains.kotlin.js.facade.TranslationResult;
|
||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus;
|
||||
import org.jetbrains.kotlin.psi.KtFile;
|
||||
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
|
||||
import org.jetbrains.kotlin.serialization.js.ModuleKind;
|
||||
import org.jetbrains.kotlin.utils.ExceptionUtilsKt;
|
||||
import org.jetbrains.kotlin.utils.PathUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -276,16 +276,16 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
configuration.put(JSConfigurationKeys.META_INFO, true);
|
||||
}
|
||||
|
||||
List<String> libraryFiles = new SmartList<String>();
|
||||
List<String> libraries = new SmartList<String>();
|
||||
if (!arguments.noStdlib) {
|
||||
libraryFiles.add(0, PathUtil.getKotlinPathsForCompiler().getJsStdLibJarPath().getAbsolutePath());
|
||||
libraries.add(0, PathUtil.getKotlinPathsForCompiler().getJsStdLibJarPath().getAbsolutePath());
|
||||
}
|
||||
|
||||
if (arguments.libraryFiles != null) {
|
||||
ContainerUtil.addAllNotNull(libraryFiles, arguments.libraryFiles);
|
||||
if (arguments.libraries != null) {
|
||||
ContainerUtil.addAllNotNull(libraries, arguments.libraries.split(File.pathSeparator));
|
||||
}
|
||||
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, libraryFiles);
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, libraries);
|
||||
|
||||
String moduleKindName = arguments.moduleKind;
|
||||
ModuleKind moduleKind = moduleKindName != null ? moduleKindMap.get(moduleKindName) : ModuleKind.PLAIN;
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ Usage: kotlinc-js <options> <source files>
|
||||
where possible options include:
|
||||
-output <path> Output file path
|
||||
-no-stdlib Don't use bundled Kotlin stdlib
|
||||
-library-files <path[,]> Path to zipped library sources or kotlin files separated by commas
|
||||
-libraries <path> Paths to Kotlin libraries with .meta.js and .kjsm files, separated by system file separator
|
||||
-source-map Generate source map
|
||||
-meta-info Generate .meta.js and .kjsm files with metadata. Use to create a library
|
||||
-target { v5 } Generate JS files for specific ECMA version
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
-libraries
|
||||
not/existing/path
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndFolderAsAnotherLib/jslib-example
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
-libraries
|
||||
compiler/testData/integration/ant/js/simpleWithStdlibAndAnotherLib/jslib-example.jar
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
$TESTDATA_DIR$/simple2js.kt
|
||||
-no-stdlib
|
||||
-library-files
|
||||
-libraries
|
||||
$TESTDATA_DIR$/wrongAbiVersionLib/wrongAbiLib.meta.js
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
<property name="library.path" value="${test.data}/jslib-example.jar"/>
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${library.path}"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<unzip src="${library.path}" dest="${temp}">
|
||||
<patternset>
|
||||
|
||||
+2
-2
@@ -3,9 +3,9 @@
|
||||
<property name="library.path" value="${test.data}/jslib-example"/>
|
||||
<target name="build">
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${library.path}"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${library.path}">
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@
|
||||
<kotlin2js src="${library.path}" output="${temp.library.path}/jslib-example.js" metaInfo="true"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
Vendored
+2
-2
@@ -8,9 +8,9 @@
|
||||
<kotlin2js src="${library.path}" output="${temp.library.path}/jslib-example.js" metaInfo="true" moduleKind="umd"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call" moduleKind="amd">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
Vendored
+4
-4
@@ -8,9 +8,9 @@
|
||||
|
||||
<kotlin2js src="${library.path1}" output="${temp.library.path}/jslib-example1.js" metaInfo="true"/>
|
||||
<kotlin2js src="${library.path2}" output="${temp.library.path}/jslib-example2.js" metaInfo="true">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
|
||||
<concat destfile="${temp.library.path}/jslib-example.js">
|
||||
@@ -26,9 +26,9 @@
|
||||
<delete file="${temp.library.path}/jslib-example2.meta.js"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
+4
-4
@@ -8,16 +8,16 @@
|
||||
|
||||
<kotlin2js src="${library.path1}" output="${temp.library.path}/jslib-example1.js" metaInfo="true"/>
|
||||
<kotlin2js src="${library.path2}" output="${temp.library.path}/jslib-example2.js" metaInfo="true">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
<pathelement path="${temp.library.path}/jslib-example2.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@
|
||||
<kotlin2js src="${library.path}" noStdlib="true" output="${temp.library.path}/jslib-example.js" metaInfo="true"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@
|
||||
<kotlin2js src="${library.path}" noStdlib="true" output="${temp.library.path}/jslib-example.js" metaInfo="true"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" noStdlib="true" output="${temp}/out.js" main="call">
|
||||
<library>
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example.meta.js"/>
|
||||
</library>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
|
||||
@@ -47,7 +47,7 @@ abstract class AbstractDiagnosticsTestWithJsStdLib : AbstractDiagnosticsTest() {
|
||||
super.setUp()
|
||||
config = LibrarySourcesConfig(project, environment.configuration.copy().apply {
|
||||
put(CommonConfigurationKeys.MODULE_NAME, KotlinTestUtils.TEST_MODULE_NAME)
|
||||
put(JSConfigurationKeys.LIBRARY_FILES, LibrarySourcesConfig.JS_STDLIB)
|
||||
put(JSConfigurationKeys.LIBRARIES, LibrarySourcesConfig.JS_STDLIB)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ class KotlinJavascriptSerializerTest : TestCaseWithTmpdir() {
|
||||
|
||||
val configuration = KotlinTestUtils.newConfiguration()
|
||||
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, LibrarySourcesConfig.JS_STDLIB)
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, LibrarySourcesConfig.JS_STDLIB)
|
||||
|
||||
configuration.addKotlinSourceRoots(srcDirs.map { it.path })
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ public abstract class AbstractDiagnosticMessageJsTest extends AbstractDiagnostic
|
||||
private JsConfig getConfig(@Nullable LanguageVersion explicitLanguageVersion) {
|
||||
CompilerConfiguration configuration = getEnvironment().getConfiguration().copy();
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, KotlinTestUtils.TEST_MODULE_NAME);
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, LibrarySourcesConfig.JS_STDLIB);
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, LibrarySourcesConfig.JS_STDLIB);
|
||||
configuration.put(CommonConfigurationKeys.DISABLE_INLINE, true);
|
||||
configuration.put(JSConfigurationKeys.UNIT_TEST_CONFIG, true);
|
||||
if (explicitLanguageVersion != null) {
|
||||
|
||||
@@ -19,7 +19,10 @@ package org.jetbrains.kotlin.compilerRunner
|
||||
import org.jetbrains.jps.api.GlobalOptions
|
||||
import org.jetbrains.kotlin.cli.common.ExitCode
|
||||
import org.jetbrains.kotlin.cli.common.KOTLIN_COMPILER_ENVIRONMENT_KEEPALIVE_PROPERTY
|
||||
import org.jetbrains.kotlin.cli.common.arguments.*
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
|
||||
import org.jetbrains.kotlin.cli.common.arguments.mergeBeans
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
import org.jetbrains.kotlin.config.CompilerSettings
|
||||
@@ -28,9 +31,6 @@ import org.jetbrains.kotlin.jps.build.KotlinBuilder
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
import java.io.PrintStream
|
||||
import java.io.Serializable
|
||||
import java.rmi.server.UnicastRemoteObject
|
||||
import java.util.*
|
||||
|
||||
class JpsKotlinCompilerRunner : KotlinCompilerRunner<JpsCompilerEnvironment>() {
|
||||
override val log: KotlinLogger = JpsKotlinLogger(KotlinBuilder.LOG)
|
||||
@@ -72,11 +72,11 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner<JpsCompilerEnvironment>() {
|
||||
compilerSettings: CompilerSettings,
|
||||
environment: JpsCompilerEnvironment,
|
||||
sourceFiles: Collection<File>,
|
||||
libraryFiles: List<String>,
|
||||
libraries: List<String>,
|
||||
outputFile: File
|
||||
) {
|
||||
val arguments = mergeBeans(commonArguments, k2jsArguments)
|
||||
setupK2JsArguments(outputFile, sourceFiles, libraryFiles, arguments)
|
||||
setupK2JsArguments(outputFile, sourceFiles, libraries, arguments)
|
||||
withCompilerSettings(compilerSettings) {
|
||||
runCompiler(K2JS_COMPILER, arguments, environment)
|
||||
}
|
||||
@@ -182,13 +182,13 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner<JpsCompilerEnvironment>() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupK2JsArguments( _outputFile: File, sourceFiles: Collection<File>, _libraryFiles: List<String>, settings: K2JSCompilerArguments) {
|
||||
private fun setupK2JsArguments(_outputFile: File, sourceFiles: Collection<File>, _libraries: List<String>, settings: K2JSCompilerArguments) {
|
||||
with(settings) {
|
||||
noStdlib = true
|
||||
freeArgs = sourceFiles.map { it.path }
|
||||
outputFile = _outputFile.path
|
||||
metaInfo = true
|
||||
libraryFiles = _libraryFiles.toTypedArray()
|
||||
libraries = _libraries.joinToString(File.pathSeparator)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -658,12 +658,12 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
val representativeModule = representativeTarget.module
|
||||
val moduleName = representativeModule.name
|
||||
val outputFile = JpsJsModuleUtils.getOutputFile(outputDir, moduleName)
|
||||
val libraryFiles = JpsJsModuleUtils.getLibraryFilesAndDependencies(representativeTarget)
|
||||
val libraries = JpsJsModuleUtils.getLibraryFilesAndDependencies(representativeTarget)
|
||||
val compilerSettings = JpsKotlinCompilerSettings.getCompilerSettings(representativeModule)
|
||||
val k2JsArguments = JpsKotlinCompilerSettings.getK2JsCompilerArguments(representativeModule)
|
||||
|
||||
val compilerRunner = JpsKotlinCompilerRunner()
|
||||
compilerRunner.runK2JsCompiler(commonArguments, k2JsArguments, compilerSettings, environment, sourceFiles, libraryFiles, outputFile)
|
||||
compilerRunner.runK2JsCompiler(commonArguments, k2JsArguments, compilerSettings, environment, sourceFiles, libraries, outputFile)
|
||||
return environment.outputItemsCollector
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.serialization.js.ModuleKind;
|
||||
import java.util.List;
|
||||
|
||||
public class JSConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<List<String>> LIBRARY_FILES =
|
||||
public static final CompilerConfigurationKey<List<String>> LIBRARIES =
|
||||
CompilerConfigurationKey.create("library file paths");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> SOURCE_MAP =
|
||||
|
||||
@@ -60,7 +60,7 @@ public class LibrarySourcesConfig extends JsConfig {
|
||||
|
||||
@NotNull
|
||||
public List<String> getLibraries() {
|
||||
return getConfiguration().getList(JSConfigurationKeys.LIBRARY_FILES);
|
||||
return getConfiguration().getList(JSConfigurationKeys.LIBRARIES);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -259,7 +259,7 @@ abstract class BasicBoxTest(
|
||||
configuration.put(CommonConfigurationKeys.LANGUAGE_VERSION_SETTINGS, LanguageVersionSettingsImpl(it, ApiVersion.LATEST))
|
||||
}
|
||||
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, LibrarySourcesConfig.JS_STDLIB + LibrarySourcesConfig.JS_KOTLIN_TEST + dependencies)
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, LibrarySourcesConfig.JS_STDLIB + LibrarySourcesConfig.JS_KOTLIN_TEST + dependencies)
|
||||
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, module.name.removeSuffix(OLD_MODULE_SUFFIX))
|
||||
configuration.put(JSConfigurationKeys.MODULE_KIND, module.moduleKind)
|
||||
|
||||
@@ -322,7 +322,7 @@ public abstract class BasicTest extends KotlinTestWithEnvironment {
|
||||
}
|
||||
librariesWithStdlib.add(getKotlinPathsForDistDirectory().getJsKotlinTestJarPath().getAbsolutePath());
|
||||
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, librariesWithStdlib);
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, librariesWithStdlib);
|
||||
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, moduleName);
|
||||
configuration.put(JSConfigurationKeys.TARGET, ecmaVersion);
|
||||
|
||||
@@ -207,7 +207,7 @@ class EncodeSignatureTest {
|
||||
val psiFile = psiManager.findFile(file) as KtFile
|
||||
|
||||
val configuration = environment.configuration.copy()
|
||||
configuration.put(JSConfigurationKeys.LIBRARY_FILES, LibrarySourcesConfig.JS_STDLIB)
|
||||
configuration.put(JSConfigurationKeys.LIBRARIES, LibrarySourcesConfig.JS_STDLIB)
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, "sample")
|
||||
|
||||
val analysisResult = TopDownAnalyzerFacadeForJS.analyzeFiles(listOf(psiFile), LibrarySourcesConfig(project, configuration))
|
||||
|
||||
+4
-4
@@ -36,9 +36,9 @@ import java.util.List;
|
||||
* has completed so that there are various kotlin files to be compiled
|
||||
*/
|
||||
public class CompileMavenGeneratedJSLibrary extends SingleFileTranslationTest {
|
||||
protected final String generatedJsDir = "libraries/tools/kotlin-js-library/target/";
|
||||
protected String generatedJsDefinitionsDir = generatedJsDir + "generated-js-definitions";
|
||||
protected File generatedJsLibraryDir = new File( generatedJsDir + "generated-js-library");
|
||||
private static final String generatedJsDir = "libraries/tools/kotlin-js-library/target/";
|
||||
private static final String generatedJsDefinitionsDir = generatedJsDir + "generated-js-definitions";
|
||||
private final File generatedJsLibraryDir = new File(generatedJsDir + "generated-js-library");
|
||||
|
||||
public CompileMavenGeneratedJSLibrary() {
|
||||
super("kotlin-js-library/");
|
||||
@@ -96,7 +96,7 @@ public class CompileMavenGeneratedJSLibrary extends SingleFileTranslationTest {
|
||||
|
||||
List<String> args = new ArrayList<String>(Arrays.asList(
|
||||
"-output", outputFile,
|
||||
"-library-files", generatedJsDefinitionsDir,
|
||||
"-libraries", generatedJsDefinitionsDir,
|
||||
"-verbose"
|
||||
));
|
||||
args.addAll(files);
|
||||
|
||||
+1
-4
@@ -325,10 +325,7 @@ open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArguments>(),
|
||||
.filter { LibraryUtils.isKotlinJavascriptLibrary(it) }
|
||||
.map { it.canonicalPath }
|
||||
|
||||
args.libraryFiles = when (friendDependency) {
|
||||
null -> dependencies.toTypedArray()
|
||||
else -> (dependencies + friendDependency).toTypedArray()
|
||||
}
|
||||
args.libraries = (dependencies + friendDependency.orEmpty()).joinToString(File.pathSeparator)
|
||||
|
||||
kotlinOptionsImpl.updateArguments(args)
|
||||
return args
|
||||
|
||||
+3
-3
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import kotlin.text.StringsKt;
|
||||
import org.apache.maven.artifact.DependencyResolutionRequiredException;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
@@ -97,8 +97,8 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
||||
} catch (DependencyResolutionRequiredException e) {
|
||||
throw new MojoExecutionException("Unresolved dependencies", e);
|
||||
}
|
||||
getLog().debug("libraryFiles: " + libraries);
|
||||
arguments.libraryFiles = ArrayUtil.toStringArray(libraries);
|
||||
getLog().debug("libraries: " + libraries);
|
||||
arguments.libraries = StringUtil.join(libraries, File.pathSeparator);
|
||||
|
||||
arguments.sourceMap = sourceMap;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user