mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +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:
parent
c521553711
commit
488356be7d
6 changed files with 75 additions and 24 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue