CLI: drop CommonCompilerArguments.createDefaultInstance
Move the corresponding default value initializers to the field declarations
This commit is contained in:
-7
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class CommonCompilerArguments extends CommonToolArguments {
|
||||
public static final long serialVersionUID = 0L;
|
||||
|
||||
@@ -87,11 +85,6 @@ public abstract class CommonCompilerArguments extends CommonToolArguments {
|
||||
)
|
||||
public String coroutinesState = WARN;
|
||||
|
||||
@NotNull
|
||||
public static CommonCompilerArguments createDefaultInstance() {
|
||||
return new DummyImpl();
|
||||
}
|
||||
|
||||
public static final String WARN = "warn";
|
||||
public static final String ERROR = "error";
|
||||
public static final String ENABLE = "enable";
|
||||
|
||||
+1
-10
@@ -16,8 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.CALL;
|
||||
import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.NO_CALL;
|
||||
|
||||
@@ -57,7 +55,7 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
valueDescription = "{ plain, amd, commonjs, umd }",
|
||||
description = "Kind of a module generated by compiler"
|
||||
)
|
||||
public String moduleKind;
|
||||
public String moduleKind = K2JsArgumentConstants.MODULE_PLAIN;
|
||||
|
||||
@GradleOption(DefaultValues.JsMain.class)
|
||||
@Argument(value = "-main", valueDescription = "{" + CALL + "," + NO_CALL + "}", description = "Whether a main function should be called")
|
||||
@@ -93,11 +91,4 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
|
||||
description = "Paths to friend modules"
|
||||
)
|
||||
public String friendModules;
|
||||
|
||||
@NotNull
|
||||
public static K2JSCompilerArguments createDefaultInstance() {
|
||||
K2JSCompilerArguments arguments = new K2JSCompilerArguments();
|
||||
arguments.moduleKind = K2JsArgumentConstants.MODULE_PLAIN;
|
||||
return arguments;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-9
@@ -16,7 +16,6 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.common.arguments;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.config.JvmTarget;
|
||||
|
||||
public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
@@ -81,7 +80,7 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
valueDescription = "<version>",
|
||||
description = "Target version of the generated JVM bytecode (1.6 or 1.8), default is 1.6"
|
||||
)
|
||||
public String jvmTarget;
|
||||
public String jvmTarget = JvmTarget.DEFAULT.getDescription();
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault.class)
|
||||
@Argument(value = "-java-parameters", description = "Generate metadata for Java 1.8 reflection on method parameters")
|
||||
@@ -149,11 +148,4 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments {
|
||||
|
||||
// Paths to output directories for friend modules.
|
||||
public String[] friendPaths;
|
||||
|
||||
@NotNull
|
||||
public static K2JVMCompilerArguments createDefaultInstance() {
|
||||
K2JVMCompilerArguments arguments = new K2JVMCompilerArguments();
|
||||
arguments.jvmTarget = JvmTarget.DEFAULT.getDescription();
|
||||
return arguments;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user