From ce7dfa84c1c39fd6cb55bb31d3b986fe6c665985 Mon Sep 17 00:00:00 2001 From: Vassiliy Kudryashov Date: Mon, 10 Dec 2012 15:58:21 +0400 Subject: [PATCH] IDEA-61945 Run and Debug commands should ignore compile errors not related to the main being run. --- .../options/CompileStepBeforeRun.java | 39 +++++++++++++++++-- .../execution/BeforeRunTaskProvider.java | 7 ++++ .../execution/impl/BeforeRunStepsPanel.java | 3 +- .../src/messages/ExecutionBundle.properties | 1 + 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java b/java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java index 229c9f5e7b33..ddd092fd3479 100644 --- a/java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java +++ b/java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java @@ -35,6 +35,7 @@ import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Key; import com.intellij.openapi.util.Ref; import com.intellij.util.concurrency.Semaphore; +import org.jdom.Element; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -70,6 +71,9 @@ public class CompileStepBeforeRun extends BeforeRunTaskProvider { + boolean myNoErrorCheck; + private MakeBeforeRunTask() { super(ID); setEnabled(true); } + + @Override + public void writeExternal(Element element) { + super.writeExternal(element); + if (myNoErrorCheck) { + element.setAttribute("no.error.check", String.valueOf(myNoErrorCheck)); + } + } + + @Override + public void readExternal(Element element) { + super.readExternal(element); + myNoErrorCheck = Boolean.parseBoolean(element.getAttributeValue("no.error.check", "false")); + } } } diff --git a/platform/lang-api/src/com/intellij/execution/BeforeRunTaskProvider.java b/platform/lang-api/src/com/intellij/execution/BeforeRunTaskProvider.java index b4c84a65d3d5..2f5ed5df1357 100644 --- a/platform/lang-api/src/com/intellij/execution/BeforeRunTaskProvider.java +++ b/platform/lang-api/src/com/intellij/execution/BeforeRunTaskProvider.java @@ -57,6 +57,13 @@ public abstract class BeforeRunTaskProvider { public abstract boolean isConfigurable(); + /** + * @return true if just created task must be configured by user. + */ + public boolean skipFirstConfiguration() { + return false; + } + /** * @return 'before run' task for the configuration or null, if the task from this provider is not applicable to the specified configuration */ diff --git a/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java b/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java index aee7558811b7..935d525b38a8 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java @@ -271,7 +271,8 @@ class BeforeRunStepsPanel extends JPanel { public void actionPerformed(AnActionEvent e) { BeforeRunTask task = provider.createTask(myRunConfiguration); if (task != null) { - provider.configureTask(myRunConfiguration, task); + if (!provider.skipFirstConfiguration()) + provider.configureTask(myRunConfiguration, task); if (!provider.canExecuteTask(myRunConfiguration, task)) return; } else { diff --git a/platform/platform-resources-en/src/messages/ExecutionBundle.properties b/platform/platform-resources-en/src/messages/ExecutionBundle.properties index 5753464627ab..041c4ff04c0a 100644 --- a/platform/platform-resources-en/src/messages/ExecutionBundle.properties +++ b/platform/platform-resources-en/src/messages/ExecutionBundle.properties @@ -312,6 +312,7 @@ configuration.action.chooser.title=Choose configuration type to run env.vars.checkbox.title=&Include parent environment variables before.launch.compile.step=Make +before.launch.compile.step.no.error.check=Make, no error check execute.before.run.debug.dialog.title=Execute {0} Before Run/Debug export.test.results.filename=Test Results - {0}