Support 'jvm-target' in CLI

This commit is contained in:
Mikhael Bogdanov
2016-06-14 11:05:32 +03:00
parent 1c3ce93275
commit 3a8591a729
4 changed files with 9 additions and 0 deletions
@@ -51,6 +51,10 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
@Argument(value = "module-name", description = "Module name")
public String moduleName;
@Argument(value = "jvm-target", description = "Compile code to specified JVM target: 1.6 or 1.8. Default one is 1.6.")
@ValueDescription("<1.6|1.8>")
public String jvmTarget;
// Advanced options
@Argument(value = "Xno-call-assertions", description = "Don't generate not-null assertion after each invocation of method returning not-null")
public boolean noCallAssertions;
@@ -128,6 +128,9 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
if (friendPaths != null) {
configuration.put(JVMConfigurationKeys.FRIEND_PATHS, friendPaths)
}
if ("1.8".equals(arguments.jvmTarget)) {
configuration.put(JVMConfigurationKeys.JVM_8_TARGET, true)
}
putAdvancedOptions(configuration, arguments)