Always use default 1.6 build target unless of 'jvm-target' option
This commit is contained in:
-3
@@ -111,9 +111,6 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
@Argument(value = "Xload-builtins-from-dependencies", description = "Load definitions of built-in declarations from module dependencies, instead of from the compiler")
|
||||
public boolean loadBuiltInsFromDependencies;
|
||||
|
||||
@Argument(value = "Xinterface-compatibility", description = "Generate DefaultImpls classes for interfaces in JVM target bytecode version 1.8 for binary compatibility with 1.6")
|
||||
public boolean interfaceCompatibility;
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
public String[] friendPaths;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user