Drop JsConfig#inlineEnabled flag

Use CommonConfigurationKeys#DISABLE_INLINE flag (moved from
JVMConfigurationKeys) in CompilerConfiguration instead, similarly to the JVM
compiler
This commit is contained in:
Alexander Udalov
2016-05-23 19:01:45 +03:00
parent 6889bdbef8
commit b65980f3b7
13 changed files with 40 additions and 40 deletions
@@ -32,6 +32,7 @@ import org.jetbrains.kotlin.cli.common.messages.*;
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler;
import org.jetbrains.kotlin.cli.jvm.compiler.CompileEnvironmentException;
import org.jetbrains.kotlin.cli.jvm.compiler.CompilerJarLocator;
import org.jetbrains.kotlin.config.CommonConfigurationKeys;
import org.jetbrains.kotlin.config.CompilerConfiguration;
import org.jetbrains.kotlin.config.Services;
import org.jetbrains.kotlin.progress.CompilationCanceledException;
@@ -233,6 +234,10 @@ public abstract class CLICompiler<A extends CommonCompilerArguments> {
private static void setupCommonArgumentsAndServices(
@NotNull CompilerConfiguration configuration, @NotNull CommonCompilerArguments arguments, @NotNull Services services
) {
if (arguments.noInline) {
configuration.put(CommonConfigurationKeys.DISABLE_INLINE, true);
}
CompilerJarLocator locator = services.get(CompilerJarLocator.class);
if (locator != null) {
configuration.put(CLIConfigurationKeys.COMPILER_JAR_LOCATOR, locator);
@@ -255,7 +255,6 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
}
EcmaVersion ecmaVersion = EcmaVersion.defaultVersion();
String moduleId = FileUtil.getNameWithoutExtension(new File(arguments.outputFile));
boolean inlineEnabled = !arguments.noInline;
List<String> libraryFiles = new SmartList<String>();
if (!arguments.noStdlib) {
@@ -269,7 +268,6 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
return new LibrarySourcesConfig.Builder(project, configuration, moduleId, libraryFiles)
.ecmaVersion(ecmaVersion)
.sourceMap(arguments.sourceMap)
.inlineEnabled(inlineEnabled)
.metaInfo(arguments.metaInfo)
.kjsm(arguments.kjsm)
.build();
@@ -282,7 +282,6 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
private fun putAdvancedOptions(configuration: CompilerConfiguration, arguments: K2JVMCompilerArguments) {
configuration.put(JVMConfigurationKeys.DISABLE_CALL_ASSERTIONS, arguments.noCallAssertions)
configuration.put(JVMConfigurationKeys.DISABLE_PARAM_ASSERTIONS, arguments.noParamAssertions)
configuration.put(JVMConfigurationKeys.DISABLE_INLINE, arguments.noInline)
configuration.put(JVMConfigurationKeys.DISABLE_OPTIMIZATION, arguments.noOptimize)
configuration.put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, arguments.declarationsOutputPath)
configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, arguments.inheritMultifileParts)