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:
Alexander Udalov
2014-07-22 17:16:37 +04:00
parent 125c5e2942
commit 87439b8e0b
14 changed files with 22 additions and 39 deletions
@@ -26,7 +26,6 @@ import org.jetbrains.jet.cli.js.K2JSCompiler
import java.io.File
import org.apache.tools.ant.BuildException
import org.jetbrains.jet.cli.common.ExitCode
import java.util.Arrays
/**
* Kotlin JavaScript compiler Ant task.
@@ -76,7 +75,7 @@ public class Kotlin2JsCompilerTask : Task() {
val arguments = K2JSCompilerArguments()
val sourcePaths = src ?: throw BuildException("\"src\" should be specified")
arguments.sourceFiles = Util.getPaths(sourcePaths.list())
arguments.freeArgs = Util.getPaths(sourcePaths.list()).toList()
val outputFile = output ?: throw BuildException("\"output\" should be specified")
arguments.outputFile = outputFile.canonicalPath
@@ -87,7 +86,7 @@ public class Kotlin2JsCompilerTask : Task() {
arguments.main = main
arguments.sourcemap = sourcemap
log("Compiling [${arguments.sourceFiles?.makeString(",")}] => [${arguments.outputFile}]");
log("Compiling ${arguments.freeArgs} => [${arguments.outputFile}]");
val compiler = K2JSCompiler()
val exitCode = compiler.exec(MessageCollectorPlainTextToStream.PLAIN_TEXT_TO_SYSTEM_ERR, arguments)
@@ -21,16 +21,10 @@ import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
/**
* General convenient utilities.
*/
public final class Util {
private Util() {
}
/**
* {@code file.getCanonicalPath()} convenience wrapper.
*
@@ -47,6 +41,7 @@ public final class Util {
}
}
@NotNull
public static String[] getPaths(String[] paths) {
String[] result = new String[paths.length];
for (int i = 0; i < paths.length; i++) {