Rename 'jvm-default-mode' to 'jvm-default'. Add description

This commit is contained in:
Mikhael Bogdanov
2018-05-28 16:14:58 +02:00
parent 020573ef3c
commit 419218b9cf
3 changed files with 21 additions and 9 deletions
@@ -224,11 +224,16 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
var noExceptionOnExplicitEqualsForBoxedNull by FreezableVar(false)
@Argument(
value = "-Xjvm-default-mode",
value = "-Xjvm-default",
valueDescription = "{disable|enable|compatibility}",
description = "Allow to use '@JvmDefault' for JVM default method support"
description = "Allow to use '@JvmDefault' annotation for JVM default method support.\n" +
"-Xjvm-default=disable Prohibit usages of @JvmDefault\n" +
"-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method\n" +
" in the interface (annotating an existing method can break binary compatibility)\n" +
"-Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor\n" +
" in the 'DefaultImpls' class in addition to the interface method\n"
)
var jvmDefaultMode: String by FreezableVar(JvmDefaultMode.DEFAULT.description)
var jvmDefault: String by FreezableVar(JvmDefaultMode.DEFAULT.description)
@Argument(value = "-Xdisable-default-scripting-plugin", description = "Do not enable scripting plugin by default")
var disableDefaultScriptingPlugin: Boolean by FreezableVar(false)
@@ -246,10 +251,10 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
supportCompatqualCheckerFrameworkAnnotations
)
result[AnalysisFlag.ignoreDataFlowInAssert] = JVMAssertionsMode.fromString(assertionsMode) != JVMAssertionsMode.LEGACY
JvmDefaultMode.fromStringOrNull(jvmDefaultMode)?.let { result[AnalysisFlag.jvmDefaultMode] = it }
JvmDefaultMode.fromStringOrNull(jvmDefault)?.let { result[AnalysisFlag.jvmDefaultMode] = it }
?: collector.report(
CompilerMessageSeverity.ERROR,
"Unknown @JvmDefault mode: $jvmDefaultMode, " +
"Unknown @JvmDefault mode: $jvmDefault, " +
"supported modes: ${JvmDefaultMode.values().map { it.description }}"
)
return result
@@ -137,9 +137,9 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
MAP.put(JVM_DEFAULT_NOT_IN_INTERFACE,"'@JvmDefault' is only supported on interface members");
MAP.put(JVM_DEFAULT_IN_JVM6_TARGET,"'@JvmDefault' is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8'");
MAP.put(JVM_DEFAULT_REQUIRED_FOR_OVERRIDE, "'@JvmDefault' is required for an override of a '@JvmDefault' member");
MAP.put(JVM_DEFAULT_IN_DECLARATION, "Usage of '@JvmDefault' is only allowed with -Xjvm-default-mode option");
MAP.put(JVM_DEFAULT_THROUGH_INHERITANCE, "Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default-mode option");
MAP.put(USAGE_OF_JVM_DEFAULT_THROUGH_SUPER_CALL, "Super calls of '@JvmDefault' members are only allowed with -Xjvm-default-mode option");
MAP.put(JVM_DEFAULT_IN_DECLARATION, "Usage of '@JvmDefault' is only allowed with -Xjvm-default option");
MAP.put(JVM_DEFAULT_THROUGH_INHERITANCE, "Inheritance from an interface with '@JvmDefault' members is only allowed with -Xjvm-default option");
MAP.put(USAGE_OF_JVM_DEFAULT_THROUGH_SUPER_CALL, "Super calls of '@JvmDefault' members are only allowed with -Xjvm-default option");
MAP.put(NON_JVM_DEFAULT_OVERRIDES_JAVA_DEFAULT, "Non-@JvmDefault interface method cannot override default Java method. Please annotate this method with @JvmDefault");
}
+8 -1
View File
@@ -18,7 +18,6 @@ where advanced options include:
-Xdisable-default-scripting-plugin
Do not enable scripting plugin by default
-Xdisable-standard-script Disable standard kotlin script support
-Xenable-jvm-default Allow to use '@JvmDefault' for JVM default method support
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
-Xmodule-path=<path> Paths where to find Java 9+ modules
-Xjavac-arguments=<option[,]> Java compiler arguments
@@ -31,6 +30,14 @@ where advanced options include:
* ignore
* strict (experimental; treat as other supported nullability annotations)
* warn (report a warning)
-Xjvm-default={disable|enable|compatibility}
Allow to use '@JvmDefault' annotation for JVM default method support.
-Xjvm-default=disable Prohibit usages of @JvmDefault
-Xjvm-default=enable Allow usages of @JvmDefault; only generate the default method
in the interface (annotating an existing method can break binary compatibility)
-Xjvm-default=compatibility Allow usages of @JvmDefault; generate a compatibility accessor
in the 'DefaultImpls' class in addition to the interface method
-Xload-builtins-from-dependencies
Load definitions of built-in declarations from module dependencies, instead of from the compiler
-Xno-call-assertions Don't generate not-null assertions for arguments of platform types