Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-03-21 23:59:54 -0400
committerAndrew Gvozdev2012-03-22 00:03:36 -0400
commitf9f991fa3fa8bd4b50b626c571820d166614833e (patch)
tree00c9b43c612c0715de3993f70f0f92b08d5d20b6 /build/org.eclipse.cdt.managedbuilder.ui
parent2789b67a23b425dec4fe00fc90058ac5be727cce (diff)
downloadorg.eclipse.cdt-f9f991fa3fa8bd4b50b626c571820d166614833e.tar.gz
org.eclipse.cdt-f9f991fa3fa8bd4b50b626c571820d166614833e.tar.xz
org.eclipse.cdt-f9f991fa3fa8bd4b50b626c571820d166614833e.zip
bug 71511: [Error Parser] Interleaved stdout and stderr output causes
spurious error task markers
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.ui')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java47
-rw-r--r--build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java46
2 files changed, 8 insertions, 85 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
index 3da83ce298..6983bcc43c 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/BuildFilesAction.java
@@ -31,7 +31,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
@@ -192,10 +191,7 @@ public class BuildFilesAction extends ActionDelegate implements
private final List<IFile> files;
BuildFilesJob(List<IFile> filesToBuild) {
- super(
- ManagedMakeMessages
- .getResourceString("BuildFilesAction.buildingSelectedFiles")); //$NON-NLS-1$
-
+ super(ManagedMakeMessages.getResourceString("BuildFilesAction.buildingSelectedFiles")); //$NON-NLS-1$
files = filesToBuild;
}
@@ -204,43 +200,8 @@ public class BuildFilesAction extends ActionDelegate implements
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
-
- Iterator<IFile> iterator = files.iterator();
-
GeneratedMakefileBuilder builder = new GeneratedMakefileBuilder();
-
- monitor
- .beginTask(
- ManagedMakeMessages
- .getResourceString("BuildFilesAction.building"), files.size()); //$NON-NLS-1$
-
- boolean isFirstFile = true;
-
- while (iterator.hasNext()) {
- IFile file = iterator.next();
-
- IManagedBuildInfo buildInfo = ManagedBuildManager
- .getBuildInfo(file.getProject());
-
- IResource[] resources = { file };
-
- // invoke the internal builder to do the build
- builder.invokeInternalBuilder(resources, buildInfo
- .getDefaultConfiguration(), false, false, isFirstFile,
- !iterator.hasNext(), monitor);
-
- if (isFirstFile) {
- isFirstFile = false;
- }
-
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
-
- }
-
- monitor.done();
- return Status.OK_STATUS;
+ return builder.invokeInternalBuilder(files, monitor);
}
/* (non-Javadoc)
@@ -260,9 +221,7 @@ public class BuildFilesAction extends ActionDelegate implements
*/
@Override
public void run(IAction action) {
-
List<IFile> selectedFiles = getSelectedBuildableFiles();
-
Job buildFilesJob = new BuildFilesJob(selectedFiles);
List<IProject> projects = getProjectsToBuild(selectedFiles);
@@ -277,7 +236,7 @@ public class BuildFilesAction extends ActionDelegate implements
private boolean shouldBeEnabled() {
- // fix for Bugzilla 139663
+ // fix for bug 139663
// if build automatically is turned on, then this menu should be turned off as
// it will trigger the auto build
Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences();
diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
index 49e3f420d5..91d33ec1d8 100644
--- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
+++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/actions/CleanFilesAction.java
@@ -13,7 +13,6 @@ package org.eclipse.cdt.managedbuilder.internal.ui.actions;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
-import java.util.Vector;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
@@ -26,7 +25,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
@@ -184,10 +182,8 @@ public class CleanFilesAction extends ActionDelegate implements
private static final class CleanFilesJob extends Job {
private final List<IFile> files;
- protected Vector<?> generationProblems;
-
- private CleanFilesJob(String name, List<IFile> filesToBuild) {
- super(name);
+ private CleanFilesJob(List<IFile> filesToBuild) {
+ super(ManagedMakeMessages.getResourceString("CleanFilesAction.cleaningFiles")); //$NON-NLS-1$
files = filesToBuild;
}
@@ -213,36 +209,9 @@ public class CleanFilesAction extends ActionDelegate implements
}
}
}
- try {
- if (files != null) {
- monitor
- .beginTask(
- ManagedMakeMessages
- .getResourceString("CleanFilesAction.cleaningFiles"), files.size()); //$NON-NLS-1$
-
- Iterator<IFile> iterator = files.iterator();
-
- // clean each file
- while (iterator.hasNext() && !monitor.isCanceled()) {
- IFile file = iterator.next();
-
- GeneratedMakefileBuilder builder = new GeneratedMakefileBuilder();
- builder.cleanFile(file, monitor);
-
- if (monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
- }
- monitor.done();
-
- }
- } catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- } finally {
- monitor.done();
- }
- return Status.OK_STATUS;
+ GeneratedMakefileBuilder builder = new GeneratedMakefileBuilder();
+ return builder.cleanFiles(files, monitor);
}
@Override
@@ -258,13 +227,8 @@ public class CleanFilesAction extends ActionDelegate implements
*/
@Override
public void run(IAction action) {
-
List<IFile> selectedFiles = getSelectedBuildableFiles();
-
- CleanFilesJob job = new CleanFilesJob(
- ManagedMakeMessages
- .getResourceString("CleanFilesAction.cleaningFiles"), selectedFiles); //$NON-NLS-1$
-
+ CleanFilesJob job = new CleanFilesJob(selectedFiles);
job.schedule();
}

Back to the top