Support "-module-name" argument for common code compiler

#KT-20892 Fixed
This commit is contained in:
Alexander Udalov
2017-11-02 18:57:08 +01:00
parent 3ede503042
commit c5c4c9cfcc
9 changed files with 35 additions and 1 deletions
@@ -31,4 +31,7 @@ class K2MetadataCompilerArguments : CommonCompilerArguments() {
description = "Paths where to find library .kotlin_metadata files"
)
var classpath: String? by FreezableVar(null)
@Argument(value = "-module-name", valueDescription = "<name>", description = "Name of the generated .kotlin_module file")
var moduleName: String? by FreezableVar(null)
}
@@ -64,7 +64,7 @@ class K2MetadataCompiler : CLICompiler<K2MetadataCompilerArguments>() {
configuration.addJvmClasspathRoots(arguments.classpath!!.split(File.pathSeparatorChar).map(::File))
}
configuration.put(CommonConfigurationKeys.MODULE_NAME, JvmAbi.DEFAULT_MODULE_NAME)
configuration.put(CommonConfigurationKeys.MODULE_NAME, arguments.moduleName ?: JvmAbi.DEFAULT_MODULE_NAME)
val destination = arguments.destination
if (destination != null) {