JPS: switch to using *CompilerArgument classes(from IDEA Project Settings) in build.

This commit is contained in:
Zalim Bashorov
2013-10-11 15:48:36 +04:00
parent 0877dfc1bd
commit 5e0ef68d64
7 changed files with 137 additions and 87 deletions
@@ -31,6 +31,7 @@ import com.intellij.util.Chunk;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments;
import org.jetbrains.jet.cli.common.messages.MessageCollector;
import org.jetbrains.jet.compiler.runner.*;
import org.jetbrains.jet.plugin.JetFileType;
@@ -133,7 +134,16 @@ public class JetCompiler implements TranslatingCompiler {
File scriptFile,
OutputItemsCollector outputItemsCollector
) {
KotlinCompilerRunner.runK2JvmCompiler(messageCollector, environment, scriptFile, outputItemsCollector);
K2JVMCompilerArguments commonArguments = new K2JVMCompilerArguments();
commonArguments.verbose = true;
commonArguments.tags = true;
commonArguments.printArgs = true;
commonArguments.version = true;
K2JVMCompilerArguments jvmArguments = new K2JVMCompilerArguments();
jvmArguments.module = scriptFile.getAbsolutePath();
KotlinCompilerRunner.runK2JvmCompiler(commonArguments, jvmArguments, messageCollector, environment, scriptFile, outputItemsCollector);
}
public static File tryToWriteScriptFile(
@@ -91,7 +91,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co
}
private boolean isGenerateNoWarnings() {
return SUPPRESS_WARNINGS.equals(commonCompilerSettings.suppress);
return commonCompilerSettings.suppressAllWarnings();
}
private void setGenerateNoWarnings(boolean selected) {
@@ -81,7 +81,7 @@ public final class JetCompilerMessagingTest extends IDECompilerMessagingTest {
@Override
protected void checkHeader(@NotNull MessageChecker checker) {
checker.expect(Message.info().textStartsWith("Using kotlinHome="));
checker.expect(Message.info().textStartsWith("Invoking in-process compiler"));
checker.expect(Message.info().textStartsWith("Invoking compiler"));
checker.expect(Message.info().textStartsWith("Kotlin Compiler version"));
checker.expect(Message.stats().textStartsWith("Using Kotlin home directory"));
checker.expect(Message.stats().text("Configuring the compilation environment"));