1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

1. Added methods to the IBuildResource for direct querying producer and dependent steps

2. Fixed Build Model java-doc comments
This commit is contained in:
Mikhail Sennikovsky 2006-04-27 15:16:06 +00:00
parent c521553711
commit 488356be7d
6 changed files with 75 additions and 24 deletions

View file

@ -23,16 +23,16 @@ import org.eclipse.core.runtime.IPath;
public interface IBuildDescription { public interface IBuildDescription {
/** /**
* Returns the main input action * Returns the main input step
* *
* @return IBuildAction * @return IBuildStep
*/ */
IBuildStep getInputStep(); IBuildStep getInputStep();
/** /**
* Returns the main output action * Returns the main output step
* *
* @return IBuildAction * @return IBuildStep
*/ */
IBuildStep getOutputStep(); IBuildStep getOutputStep();

View file

@ -19,7 +19,7 @@ package org.eclipse.cdt.managedbuilder.buildmodel;
*/ */
public interface IBuildIOType { public interface IBuildIOType {
/** /**
* Specifies whether this argument is Action input or output * Specifies whether this argument is Step input or output
* *
* @return boolean * @return boolean
*/ */
@ -33,9 +33,9 @@ public interface IBuildIOType {
IBuildResource[] getResources(); IBuildResource[] getResources();
/** /**
* Specifies the build action this argument belongs to * Specifies the build step this argument belongs to
* *
* @return IBuildAction * @return IBuildStep
*/ */
IBuildStep getStep(); IBuildStep getStep();
} }

View file

@ -26,34 +26,55 @@ public interface IBuildResource {
IPath getLocation(); IPath getLocation();
/** /**
* Returns the resource path related to the project directory * In case the resource is a workspace resource,
* or an absolute path(location) in case the resource * returns the full workspace path for the resource
* is located outside the project directory * otherwise returns null
* *
* @return IPath * @return IPath
*/ */
IPath getFullPath(); IPath getFullPath();
/** /**
* Returns the output argument of the action * Returns the output io type of the step
* That generates this resource. * that generates this resource.
* In case the resource is the project source, * In case the resource is the project source,
* The main input action is returned * The returned output io type belongs to the main input step
* @see IBuildRepresentation.getInputAction()
* *
* @return IBuildArgument * @see IBuildRepresentation.getInputStep()
*
* @return IBuildIOType
*/ */
IBuildIOType getProducerIOType(); 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(); 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 * Returns true if the resource needs rebuild
* this implies that all build steps dependent on this resource
* are to be invoked
* *
* @return boolean * @return boolean
*/ */

View file

@ -22,7 +22,7 @@ import org.eclipse.core.runtime.IPath;
*/ */
public interface IBuildStep { public interface IBuildStep {
/** /**
* Returns an array of input arguments for this action * Returns an array of input types for this step
* @see IBuildIOType * @see IBuildIOType
* *
* @return IBuildIOType[] * @return IBuildIOType[]
@ -30,7 +30,7 @@ public interface IBuildStep {
IBuildIOType[] getInputIOTypes(); IBuildIOType[] getInputIOTypes();
/** /**
* Returns an array of input arguments for this action * Returns an array of output types for this step
* @see IBuildIOType * @see IBuildIOType
* *
* @return IBuildIOType[] * @return IBuildIOType[]
@ -38,28 +38,28 @@ public interface IBuildStep {
IBuildIOType[] getOutputIOTypes(); IBuildIOType[] getOutputIOTypes();
/** /**
* Returns true if the action needs rebuild, false - otherwise * Returns true if the step needs rebuild, false - otherwise
* *
* @return boolean * @return boolean
*/ */
boolean needsRebuild(); boolean needsRebuild();
/** /**
* Returns the complete set of input resources for this action * Returns the complete set of input resources for this step
* *
* @return IBuildResource[] * @return IBuildResource[]
*/ */
IBuildResource[] getInputResources(); IBuildResource[] getInputResources();
/** /**
* Returns the complete set of output resources for this action * Returns the complete set of output resources for this step
* *
* @return IBuildResource[] * @return IBuildResource[]
*/ */
IBuildResource[] getOutputResources(); 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) * of the project resources that were ised in thie action)
* *
* @return boolean * @return boolean

View file

@ -21,17 +21,29 @@ import org.eclipse.core.runtime.CoreException;
* *
*/ */
public interface IStepVisitor { 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; 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; public static final int VISIT_STOP = 2;
/** /**
* this call-back method is called by the build description * this call-back method is called by the build description
* visitor mechanism for each step in 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) * @see BuildDescriptionManager#accept(IStepVisitor, IBuildDescription, boolean)
* *
* @param step * @param step
* @return * @return int
* @throws CoreException * @throws CoreException
*/ */
int visit(IBuildStep step) throws CoreException; int visit(IBuildStep step) throws CoreException;

View file

@ -11,11 +11,15 @@
package org.eclipse.cdt.managedbuilder.internal.buildmodel; package org.eclipse.cdt.managedbuilder.internal.buildmodel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildDescription;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildIOType; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildIOType;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource; import org.eclipse.cdt.managedbuilder.buildmodel.IBuildResource;
import org.eclipse.cdt.managedbuilder.buildmodel.IBuildStep;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
@ -165,4 +169,18 @@ public class BuildResource implements IBuildResource {
return fInfo; 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;
}
} }