Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2005-03-21 04:37:17 +0000
committerDarin Swanson2005-03-21 04:37:17 +0000
commit093fd3eadb13ead31b431aedcb67adf678acbc14 (patch)
tree812c1dd68ee5890228686bbbe716d099c715ddc0 /org.eclipse.ui.externaltools
parent20cc01016402470faaa4f2a22cc65a1fbdd522a9 (diff)
downloadeclipse.platform.debug-093fd3eadb13ead31b431aedcb67adf678acbc14.tar.gz
eclipse.platform.debug-093fd3eadb13ead31b431aedcb67adf678acbc14.tar.xz
eclipse.platform.debug-093fd3eadb13ead31b431aedcb67adf678acbc14.zip
Bug 85752 - External builder not started when configured with a resource working set
Diffstat (limited to 'org.eclipse.ui.externaltools')
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java33
1 files changed, 11 insertions, 22 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
index d4668e8b1..b260cc3b9 100644
--- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
+++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolBuilder.java
@@ -12,10 +12,7 @@ package org.eclipse.ui.externaltools.internal.model;
import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
-
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -61,8 +58,6 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
private static IProject buildProject= null;
- private List fProjectsWithinScope;
-
/* (non-Javadoc)
* @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor)
*/
@@ -71,17 +66,24 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return null;
}
- fProjectsWithinScope= new ArrayList();
ILaunchConfiguration config= BuilderUtils.configFromBuildCommandArgs(getProject(), args, new String[1]);
if (config == null) {
throw ExternalToolsPlugin.newError(ExternalToolsModelMessages.getString("ExternalToolBuilder.0"), null); //$NON-NLS-1$
}
+ IProject[] projectsWithinScope= null;
+ IResource[] resources = ExternalToolsUtil.getResourcesForBuildScope(config);
+ if (resources != null) {
+ projectsWithinScope= new IProject[resources.length];
+ for (int i = 0; i < resources.length; i++) {
+ projectsWithinScope[i]= resources[i].getProject();
+ }
+ }
boolean kindCompatible= commandConfiguredForKind(config, kind);
if (kindCompatible && configEnabled(config)) {
- doBuildBasedOnScope(kind, config, monitor);
+ doBuildBasedOnScope(resources, kind, config, monitor);
}
- return getProjectsWithinScope();
+ return projectsWithinScope;
}
private boolean commandConfiguredForKind(ILaunchConfiguration config, int kind) {
@@ -150,23 +152,10 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return true;
}
- private IProject[] getProjectsWithinScope() {
- if (fProjectsWithinScope == null || fProjectsWithinScope.isEmpty()) {
- fProjectsWithinScope = null;
- return null;
- }
- return (IProject[])fProjectsWithinScope.toArray(new IProject[fProjectsWithinScope.size()]);
- }
-
- private void doBuildBasedOnScope(int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
+ private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException {
boolean buildForChange = true;
if (kind != FULL_BUILD) { //scope not applied for full builds
- IResource[] resources = ExternalToolsUtil.getResourcesForBuildScope(config);
if (resources != null && resources.length > 0) {
- for (int i = 0; i < resources.length; i++) {
- IResource resource = resources[i];
- fProjectsWithinScope.add(resource.getProject());
- }
buildForChange = buildScopeIndicatesBuild(resources);
}
}

Back to the top