Always use default 1.6 build target unless of 'jvm-target' option

This commit is contained in:
Mikhael Bogdanov
2016-12-12 10:33:33 +01:00
parent ef662a5679
commit dc5c3a478c
14 changed files with 27 additions and 106 deletions
@@ -133,7 +133,12 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
if (arguments.jvmTarget != null) {
val jvmTarget = JvmTarget.fromString(arguments.jvmTarget)
if (jvmTarget != null) {
configuration.put(JVMConfigurationKeys.JVM_TARGET, jvmTarget)
if (jvmTarget == JvmTarget.JVM_1_8) {
val warning = "The -jvm-target option has no effect yet"
messageCollector.report(CompilerMessageSeverity.WARNING, warning, CompilerMessageLocation.NO_LOCATION)
}
//use default target for now
//configuration.put(JVMConfigurationKeys.JVM_TARGET, jvmTarget)
}
else {
val errorMessage = "Unknown JVM target version: ${arguments.jvmTarget}\n" +
@@ -144,17 +149,6 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
configuration.put(JVMConfigurationKeys.PARAMETERS_METADATA, arguments.javaParameters)
if (arguments.interfaceCompatibility) {
val target = configuration.get(JVMConfigurationKeys.JVM_TARGET)
if (target != JvmTarget.JVM_1_8) {
val errorMessage = "The -Xinterface-compatibility option has effect only for JVM target bytecode version 1.8."
messageCollector.report(CompilerMessageSeverity.WARNING, errorMessage, CompilerMessageLocation.NO_LOCATION)
}
else {
configuration.put(JVMConfigurationKeys.INTERFACE_COMPATIBILITY, true)
}
}
putAdvancedOptions(configuration, arguments)
messageCollector.report(CompilerMessageSeverity.LOGGING, "Configuring the compilation environment", CompilerMessageLocation.NO_LOCATION)