org.eclipse.cdt.managedbuilder.makegen
Interface IManagedDependencyGenerator2

All Superinterfaces:
IManagedDependencyGeneratorType
All Known Implementing Classes:
DefaultGCCDependencyCalculator2, DefaultGCCDependencyCalculator3, DefaultGCCDependencyCalculatorPreBuild, PDOMDependencyGenerator

public interface IManagedDependencyGenerator2
extends IManagedDependencyGeneratorType

Since:
3.1 A Tool dependency calculator must implement this interface. This interface replaces IManagedDependencyGenerator which is deprecated. Discussion of Dependency Calculation: There are two major, and multiple minor, modes of dependency calculation supported by the MBS. The major modes are: 1. The build file generator invokes tool integrator provided methods that calculate all dependencies using whatever method the tool integrator wants. The build file generator then adds the dependencies to the build file using the appropriate build file syntax. This is a TYPE_CUSTOM dependency calculator as defined below. See the IManagedDependencyCalculator interface for more information. 2. The build file generator and the tool-chain cooperate in creating and using separate "dependency" files. In this case, dependency calculation is done at "build time", rather than at "build file generation time" as in mode #1. This currently supports the GNU concept of using .d files in GNU make. This is either a TYPE_BUILD_COMMANDS dependency calculator or a TYPE_PREBUILD_COMMANDS dependency calculator as defined below. See the IManagedDependencyCommands and IManagedDependencyPreBuild interfaces for more information.

Field Summary
 
Fields inherited from interface org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType
TYPE_BUILD_COMMANDS, TYPE_COMMAND, TYPE_CUSTOM, TYPE_EXTERNAL, TYPE_INDEXER, TYPE_NODEPENDENCIES, TYPE_NODEPS, TYPE_OLD_TYPE_LIMIT, TYPE_PREBUILD_COMMANDS
 
Method Summary
 java.lang.String getDependencyFileExtension(IConfiguration buildContext, ITool tool)
          Returns the file extension used by dependency files created by this dependency generator.
 IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source, IBuildObject buildContext, ITool tool, org.eclipse.core.runtime.IPath topBuildDirectory)
          Returns an instance of IManagedDependencyInfo for this source file.
 IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source, org.eclipse.core.resources.IResource resource, IBuildObject buildContext, ITool tool, org.eclipse.core.runtime.IPath topBuildDirectory)
          Returns an instance of IManagedDependencyInfo for this source file.
 boolean postProcessDependencyFile(org.eclipse.core.runtime.IPath dependencyFile, IConfiguration buildContext, ITool tool, org.eclipse.core.runtime.IPath topBuildDirectory)
          Called to allow the dependency calculator to post-process dependency files.
 
Methods inherited from interface org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType
getCalculatorType
 

Method Detail

getDependencySourceInfo

IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source,
                                               org.eclipse.core.resources.IResource resource,
                                               IBuildObject buildContext,
                                               ITool tool,
                                               org.eclipse.core.runtime.IPath topBuildDirectory)
Returns an instance of IManagedDependencyInfo for this source file. IManagedDependencyCalculator, IManagedDependencyCommands and IManagedDependencyPreBuild are all derived from IManagedDependencyInfo, and any one of the three can be returned. This is called when getCalculatorType returns TYPE_BUILD_COMMANDS, TYPE_CUSTOM or TYPE_PREBUILD_COMMANDS.

Parameters:
source - The source file for which dependencies should be calculated The IPath can be either relative to the project directory, or absolute in the file system.
resource - The IResource corresponding to the source file, or null if the file is not a workspace resource.
buildContext - The IConfiguration or IResourceConfiguration that contains the context in which the source file will be built
tool - The tool associated with the source file
topBuildDirectory - The top build directory of the configuration. This is the working directory for the tool. This IPath is relative to the project directory.
Returns:
IManagedDependencyInfo

getDependencySourceInfo

IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source,
                                               IBuildObject buildContext,
                                               ITool tool,
                                               org.eclipse.core.runtime.IPath topBuildDirectory)
Returns an instance of IManagedDependencyInfo for this source file. IManagedDependencyCalculator, IManagedDependencyCommands and IManagedDependencyPreBuild are all derived from IManagedDependencyInfo, and any one of the three can be returned. This is called when getCalculatorType returns TYPE_BUILD_COMMANDS, TYPE_CUSTOM or TYPE_PREBUILD_COMMANDS.

Parameters:
source - The source file for which dependencies should be calculated The IPath can be either relative to the project directory, or absolute in the file system.
buildContext - The IConfiguration or IResourceConfiguration that contains the context in which the source file will be built
tool - The tool associated with the source file
topBuildDirectory - The top build directory of the configuration. This is the working directory for the tool. This IPath is relative to the project directory.
Returns:
IManagedDependencyInfo

getDependencyFileExtension

java.lang.String getDependencyFileExtension(IConfiguration buildContext,
                                            ITool tool)
Returns the file extension used by dependency files created by this dependency generator. This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or TYPE_PREBUILD_COMMANDS.

Parameters:
buildContext - The IConfiguration that contains the context of the build
tool - The tool associated with the dependency generator.
Returns:
String

postProcessDependencyFile

boolean postProcessDependencyFile(org.eclipse.core.runtime.IPath dependencyFile,
                                  IConfiguration buildContext,
                                  ITool tool,
                                  org.eclipse.core.runtime.IPath topBuildDirectory)
Called to allow the dependency calculator to post-process dependency files. This method is called after the build has completed for at least every dependency file that has changed, and possibly for those that have not changed as well. It may also be called with dependency files created by another tool. This method should be able to recognize dependency files that don't belong to it, or that it has already post-processed. This is called when getCalculatorType returns TYPE_BUILD_COMMANDS or TYPE_PREBUILD_COMMANDS.

Parameters:
dependencyFile - The dependency file The IPath can be either relative to the top build directory, or absolute in the file system.
buildContext - The IConfiguration that contains the context of the build
tool - The tool associated with the dependency generator. Note that this is not necessarily the tool that created the dependency file
topBuildDirectory - The top build directory of the project. This is the working directory for the tool.
Returns:
boolean True if the method modified the dependency (e.g., .d) file