generate kjsm-files for js-stdlib and during compilation via maven or gradle

This commit is contained in:
Michael Nedzelsky
2015-11-23 16:12:47 +03:00
parent c80c33efb6
commit ac8dd1262c
3 changed files with 21 additions and 7 deletions
@@ -249,6 +249,8 @@ public open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArgumen
override fun createBlankArgs(): K2JSCompilerArguments {
val args = K2JSCompilerArguments()
args.libraryFiles = arrayOf<String>() // defaults to null
args.metaInfo = true
args.kjsm = true
return args
}
@@ -280,6 +282,7 @@ public open class Kotlin2JsCompile() : AbstractKotlinCompile<K2JSCompilerArgumen
args.outputPrefix = kotlinOptions.outputPrefix
args.outputPostfix = kotlinOptions.outputPostfix
args.metaInfo = kotlinOptions.metaInfo
args.kjsm = kotlinOptions.kjsm
val kotlinJsLibsFromDependencies =
getProject().getConfigurations().getByName("compile")
@@ -62,6 +62,12 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
@Parameter(defaultValue = "true")
private boolean metaInfo;
/**
* Flag enables or disables kjsm generation
*/
@Parameter(defaultValue = "true")
private boolean kjsm;
/**
* Flags enables or disable source map generation
*/
@@ -73,6 +79,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
arguments.outputFile = outputFile;
arguments.noStdlib = true;
arguments.metaInfo = metaInfo;
arguments.kjsm = kjsm;
List<String> libraries = getKotlinJavascriptLibraryFiles();
getLog().debug("libraryFiles: " + libraries);