Command line interface

This commit is contained in:
Svyatoslav Kuzmich
2019-04-18 14:37:25 +03:00
parent 89500d776d
commit bb3b9a935f
7 changed files with 431 additions and 2 deletions
@@ -567,8 +567,20 @@ open class Kotlin2JsCompile : AbstractKotlinCompile<K2JSCompilerArguments>(), Ko
logger.debug("Calling compiler")
destinationDir.mkdirs()
val libraryFilter: (File) -> Boolean
if ("-Xir" in args.freeArgs) {
logger.kotlinDebug("Using JS IR backend")
incremental = false
// TODO: Detect IR libraries
libraryFilter = { true }
} else {
libraryFilter = LibraryUtils::isKotlinJavascriptLibrary
}
val dependencies = compileClasspath
.filter { LibraryUtils.isKotlinJavascriptLibrary(it) }
.filter(libraryFilter)
.map { it.canonicalPath }
args.libraries = (dependencies + listOfNotNull(friendDependency)).distinct().let {