diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java index fadcdac..75246a9 100644 --- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java +++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/BuildManager.java @@ -725,7 +725,7 @@ if (trigger != IncrementalProjectBuilder.CLEAN_BUILD) prereqs = currentBuilder.build(trigger, args, monitor); else - currentBuilder.clean(monitor); + currentBuilder.clean(args, monitor); if (prereqs == null) prereqs = new IProject[0]; currentBuilder.setInterestingProjects(prereqs.clone()); diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/InternalBuilder.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/InternalBuilder.java index d364333..76322d5 100644 --- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/InternalBuilder.java +++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/internal/events/InternalBuilder.java @@ -11,8 +11,6 @@ *******************************************************************************/ package org.eclipse.core.internal.events; -import org.eclipse.core.resources.IBuildConfiguration; - import java.util.Map; import org.eclipse.core.internal.resources.ICoreConstants; import org.eclipse.core.internal.watson.ElementTree; @@ -62,7 +60,7 @@ /* * @see IncrementalProjectBuilder#build */ - protected abstract IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException; + protected abstract IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException; /** * Returns the value of the callOnEmptyDelta builder extension attribute. @@ -70,6 +68,12 @@ final boolean callOnEmptyDelta() { return callOnEmptyDelta; } + + /* + * @see IncrementalProjectBuilder + */ + protected abstract void clean(Map args, IProgressMonitor monitor) throws CoreException; + /* * @see IncrementalProjectBuilder */ @@ -103,9 +107,9 @@ * @see IncrementalProjectBuilder#getCommand */ protected ICommand getCommand() { - return (ICommand)((BuildCommand)command).clone(); + return (ICommand) ((BuildCommand) command).clone(); } - + /** * @see IncrementalProjectBuilder#forgetLastBuiltState() * @see IncrementalProjectBuilder#rememberLastBuiltState() @@ -113,10 +117,10 @@ protected IResourceDelta getDelta(IProject aProject) { return buildManager.getDelta(aProject); } - + /** * @see IncrementalProjectBuilder#getContext() - */ + */ protected IBuildContext getContext() { return context; } @@ -179,7 +183,7 @@ protected void needRebuild() { buildManager.requestRebuild(); } - + final void setCallOnEmptyDelta(boolean value) { this.callOnEmptyDelta = value; } @@ -187,7 +191,7 @@ final void setCommand(ICommand value) { this.command = value; } - + final void setInterestingProjects(IProject[] value) { interestingProjects = value; } diff --git a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IncrementalProjectBuilder.java b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IncrementalProjectBuilder.java index 4c3a0f2..d8f2dd1 100644 --- a/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IncrementalProjectBuilder.java +++ b/bundles/org.eclipse.core.resources/src/org/eclipse/core/resources/IncrementalProjectBuilder.java @@ -141,7 +141,31 @@ * @exception CoreException if this build fails. * @see IProject#build(int, String, Map, IProgressMonitor) */ - protected abstract IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException; + protected abstract IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException; + + /** + * This method is equivalent to {@link IncrementalProjectBuilder#clean(IProgressMonitor)}, with + * the additional possibility to pass builder specific arguments to the clean step. + *

+ * This method is called as a result of invocations of + * IProject.build where the build kind is {@link #CLEAN_BUILD}. + *

+ * This default implementation does nothing. Subclasses may override. + *

+ * + * @param args a table of builder-specific arguments keyed by argument name + * (key type: String, value type: String); + * null is equivalent to an empty map + * @param monitor a progress monitor, or null if progress + * reporting and cancellation are not desired + * @exception CoreException if this build fails. + * @see IncrementalProjectBuilder#clean(IProgressMonitor) + * @since 3.8 + */ + protected void clean(Map args, IProgressMonitor monitor) throws CoreException { + //default implementation forwards to old interface without argument map + clean(monitor); + } /** * Clean is an opportunity for a builder to discard any additional state that has @@ -419,8 +443,8 @@ *

  • * The rule returned here may have no effect if the build is invoked within the * scope of another operation that locks the entire workspace. - *
  • - *
  • + *
  • + *
  • * If this method returns any rule other than the workspace root, * resources outside of the rule scope can be modified concurrently with the build. * The delta returned by {@link #getDelta(IProject)} for any project @@ -450,7 +474,7 @@ * * @since 3.6 */ - public ISchedulingRule getRule(int kind, Map args) { + public ISchedulingRule getRule(int kind, Map args) { return getRule(); }