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:
Alexander Udalov
2017-01-30 18:54:24 +03:00
parent fd24031a69
commit 464820458e
30 changed files with 68 additions and 77 deletions
@@ -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 {