K2JS: introduce "no-stdlb" parameter and use stdlib from compiler by default.

This commit is contained in:
Zalim Bashorov
2014-10-27 22:58:27 +03:00
parent e457eea438
commit adab0445de
29 changed files with 82 additions and 20 deletions
@@ -18,12 +18,8 @@ package org.jetbrains.jet.buildtools.ant
import org.apache.tools.ant.types.Path
import org.jetbrains.jet.cli.common.arguments.K2JSCompilerArguments
import org.jetbrains.jet.cli.common.messages.MessageCollectorPlainTextToStream
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 org.jetbrains.jet.config.Services
/**
* Kotlin JavaScript compiler Ant task.
@@ -58,6 +54,13 @@ public class Kotlin2JsTask : KotlinCompilerBaseTask<K2JSCompilerArguments>() {
override fun fillSpecificArguments() {
arguments.outputFile = getPath(output!!)
arguments.noStdlib = noStdlib
// TODO: write test
library?.let {
arguments.libraryFiles = it.list().map { getPath(File(it)) }.copyToArray()
}
arguments.outputPrefix = outputPrefix?.canonicalPath
arguments.outputPostfix = outputPostfix?.canonicalPath
@@ -39,7 +39,6 @@ public class Kotlin2JvmTask : KotlinCompilerBaseTask<K2JVMCompilerArguments>()
override val arguments = K2JVMCompilerArguments()
override val compiler = K2JVMCompiler()
public var noStdlib: Boolean = false
public var externalAnnotations: Path? = null
public var includeRuntime: Boolean = true
@@ -61,6 +61,8 @@ public abstract class KotlinCompilerBaseTask<T : CommonCompilerArguments> : Task
public var verbose: Boolean = false
public var printVersion: Boolean = false
public var noStdlib: Boolean = false
public val additionalArguments: MutableList<Commandline.Argument> = arrayListOf()
public fun createSrc(): Path {