diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java index 99507491d68..e43a9f3f897 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildDescription.java @@ -23,16 +23,16 @@ import org.eclipse.core.runtime.IPath; public interface IBuildDescription { /** - * Returns the main input action + * Returns the main input step * - * @return IBuildAction + * @return IBuildStep */ IBuildStep getInputStep(); /** - * Returns the main output action + * Returns the main output step * - * @return IBuildAction + * @return IBuildStep */ IBuildStep getOutputStep(); diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java index 35cbc144719..ddf7a2d76fc 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildIOType.java @@ -19,7 +19,7 @@ package org.eclipse.cdt.managedbuilder.buildmodel; */ public interface IBuildIOType { /** - * Specifies whether this argument is Action input or output + * Specifies whether this argument is Step input or output * * @return boolean */ @@ -33,9 +33,9 @@ public interface IBuildIOType { IBuildResource[] getResources(); /** - * Specifies the build action this argument belongs to + * Specifies the build step this argument belongs to * - * @return IBuildAction + * @return IBuildStep */ IBuildStep getStep(); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java index c88ed1623d2..6b727b35bc3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildResource.java @@ -26,34 +26,55 @@ public interface IBuildResource { IPath getLocation(); /** - * Returns the resource path related to the project directory - * or an absolute path(location) in case the resource - * is located outside the project directory + * In case the resource is a workspace resource, + * returns the full workspace path for the resource + * otherwise returns null * * @return IPath */ IPath getFullPath(); /** - * Returns the output argument of the action - * That generates this resource. + * Returns the output io type of the step + * that generates this resource. * In case the resource is the project source, - * The main input action is returned - * @see IBuildRepresentation.getInputAction() + * The returned output io type belongs to the main input step * - * @return IBuildArgument + * @see IBuildRepresentation.getInputStep() + * + * @return IBuildIOType */ IBuildIOType getProducerIOType(); /** - * Returns an array of arguments where this resource is used as an input + * Returns an array of io types where this resource is used as an input * - * @return IBuildArgument[] + * @return IBuildIOType[] */ IBuildIOType[] getDependentIOTypes(); + /** + * Returns the step that generates this resource. + * In case the resource is the project source, + * The main input step is returned + * + * @see IBuildRepresentation.getInputStep() + * + * @return IBuildIOType + */ + IBuildStep getProducerStep(); + + /** + * Returns an array of steps that use this resource as an input + * + * @return IBuildIOType[] + */ + IBuildStep[] getDependentSteps(); + /** * Returns true if the resource needs rebuild + * this implies that all build steps dependent on this resource + * are to be invoked * * @return boolean */ diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java index 63cd2c0f90b..07440b842cf 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IBuildStep.java @@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IPath; */ public interface IBuildStep { /** - * Returns an array of input arguments for this action + * Returns an array of input types for this step * @see IBuildIOType * * @return IBuildIOType[] @@ -30,7 +30,7 @@ public interface IBuildStep { IBuildIOType[] getInputIOTypes(); /** - * Returns an array of input arguments for this action + * Returns an array of output types for this step * @see IBuildIOType * * @return IBuildIOType[] @@ -38,28 +38,28 @@ public interface IBuildStep { IBuildIOType[] getOutputIOTypes(); /** - * Returns true if the action needs rebuild, false - otherwise + * Returns true if the step needs rebuild, false - otherwise * * @return boolean */ boolean needsRebuild(); /** - * Returns the complete set of input resources for this action + * Returns the complete set of input resources for this step * * @return IBuildResource[] */ IBuildResource[] getInputResources(); /** - * Returns the complete set of output resources for this action + * Returns the complete set of output resources for this step * * @return IBuildResource[] */ IBuildResource[] getOutputResources(); /** - * Returns true if the action is removed (due to removal + * Returns true if the step is removed (due to removal * of the project resources that were ised in thie action) * * @return boolean diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java index 08ebee65dbe..5c357a2e4ff 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/buildmodel/IStepVisitor.java @@ -21,17 +21,29 @@ import org.eclipse.core.runtime.CoreException; * */ public interface IStepVisitor { + /** + * This constant can is returneed by the step visitor + * to tell the visitor mechanism to continue step visiting process + */ public static final int VISIT_CONTINUE = 1; + + /** + * This constant can is returneed by the step visitor + * to tell the visitor mechanism to stop step visiting process + */ public static final int VISIT_STOP = 2; /** * this call-back method is called by the build description * visitor mechanism for each step in the build description + * The method should return one of the IStepVisitor.VISIT_xxx constants * + * @see IStepVisitor#VISIT_CONTINUE + * @see IStepVisitor#VISIT_STOP * @see BuildDescriptionManager#accept(IStepVisitor, IBuildDescription, boolean) * * @param step - * @return + * @return int * @throws CoreException */ int visit(IBuildStep step) throws CoreException; diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java index 904808315a5..d73956dbf90 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/buildmodel/BuildResource.java @@ -11,11 +11,15 @@ package org.eclipse.cdt.managedbuilder.internal.buildmodel; import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; import java.util.List; +import java.util.Set; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildIOType; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource; +import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IPath; @@ -165,4 +169,18 @@ public class BuildResource implements IBuildResource { return fInfo; } + public IBuildStep[] getDependentSteps() { + Set set = new HashSet(); + for(Iterator iter = fDepArgs.iterator(); iter.hasNext();){ + set.add(((BuildIOType)iter.next()).getStep()); + } + return (BuildStep[])set.toArray(new BuildStep[set.size()]); + } + + public IBuildStep getProducerStep() { + if(fProducerArg != null) + return fProducerArg.getStep(); + return null; + } + }