Drop "-sourceFiles" in kotlinc-js
Use free arguments instead, as is done in kotlinc-jvm and all sensible compilers everywhere Also fix some cases of AntTaskTest to be able to run them locally
This commit is contained in:
-4
@@ -35,10 +35,6 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
@ValueDescription("<path[,]>")
|
||||
public String[] libraryFiles;
|
||||
|
||||
@Argument(value = "sourceFiles", description = "Source files or directories separated by commas")
|
||||
@ValueDescription("<path[,]>")
|
||||
public String[] sourceFiles;
|
||||
|
||||
@Argument(value = "sourcemap", description = "Generate SourceMap")
|
||||
public boolean sourcemap;
|
||||
|
||||
|
||||
@@ -76,13 +76,13 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
|
||||
@NotNull MessageCollector messageCollector,
|
||||
@NotNull Disposable rootDisposable
|
||||
) {
|
||||
if (arguments.sourceFiles == null) {
|
||||
messageCollector.report(CompilerMessageSeverity.ERROR, "Specify sources location via -sourceFiles", NO_LOCATION);
|
||||
if (arguments.freeArgs.isEmpty()) {
|
||||
messageCollector.report(CompilerMessageSeverity.ERROR, "Specify at least one source file or directory", NO_LOCATION);
|
||||
return ExitCode.INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
CompilerConfiguration configuration = new CompilerConfiguration();
|
||||
configuration.addAll(CommonConfigurationKeys.SOURCE_ROOTS_KEY, Arrays.asList(arguments.sourceFiles));
|
||||
configuration.addAll(CommonConfigurationKeys.SOURCE_ROOTS_KEY, arguments.freeArgs);
|
||||
JetCoreEnvironment environmentForJS = JetCoreEnvironment.createForProduction(rootDisposable, configuration);
|
||||
|
||||
Project project = environmentForJS.getProject();
|
||||
|
||||
Reference in New Issue
Block a user