Configuration: Don't create kotlinc.xml if the settings don't differ from the defaults

#KT-16647 Fixed
This commit is contained in:
Alexey Sedunov
2017-03-09 15:37:28 +03:00
parent e8749e639c
commit 6b6d7a5030
27 changed files with 515 additions and 244 deletions
@@ -99,6 +99,15 @@ public abstract class CommonCompilerArguments implements Serializable {
public List<String> unknownExtraFlags = new SmartList<String>();
@NotNull
public static CommonCompilerArguments createDefaultInstance() {
DummyImpl arguments = new DummyImpl();
arguments.coroutinesEnable = false;
arguments.coroutinesWarn = true;
arguments.coroutinesError = false;
return arguments;
}
@NotNull
public String executableScriptFileName() {
return "kotlinc";
@@ -71,6 +71,13 @@ public class K2JSCompilerArguments extends CommonCompilerArguments {
@ValueDescription("<path>")
public String outputPostfix;
@NotNull
public static K2JSCompilerArguments createDefaultInstance() {
K2JSCompilerArguments arguments = new K2JSCompilerArguments();
arguments.moduleKind = K2JsArgumentConstants.MODULE_PLAIN;
return arguments;
}
@Override
@NotNull
public String executableScriptFileName() {
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.cli.common.arguments;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.cli.common.parser.com.sampullara.cli.Argument;
import org.jetbrains.kotlin.config.JvmTarget;
public class K2JVMCompilerArguments extends CommonCompilerArguments {
public static final long serialVersionUID = 0L;
@@ -113,10 +114,16 @@ 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;
}
@Override
@NotNull
public String executableScriptFileName() {
return "kotlinc-jvm";
}
}