org.eclipse.cdt.managedbuilder.pdomdepgen
Class PDOMDependencyGenerator

java.lang.Object
  extended by org.eclipse.cdt.managedbuilder.pdomdepgen.PDOMDependencyGenerator
All Implemented Interfaces:
IManagedDependencyGenerator2, IManagedDependencyGeneratorType

public class PDOMDependencyGenerator
extends java.lang.Object
implements IManagedDependencyGenerator2

Author:
Doug Schaefer

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
 
Constructor Summary
PDOMDependencyGenerator()
           
 
Method Summary
 int getCalculatorType()
          Returns the type of dependency generator that is implemented.
 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 class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDOMDependencyGenerator

public PDOMDependencyGenerator()
Method Detail

getCalculatorType

public int getCalculatorType()
Description copied from interface: IManagedDependencyGeneratorType
Returns the type of dependency generator that is implemented. TYPE_NODEPENDENCIES indicates that no dependency generator is supplied or needed. TYPE_CUSTOM indicates that a custom, "build file generation time" dependency calculator is implemented. Note that the dependency calculator will be called when the makefile is generated, and for every source file that is built by this tool in the build file, not just for those that have changed since the last build file generation. TYPE_BUILD_COMMANDS indicates that command lines or options will be returned to be used to calculate dependencies. These commands/options are added to the build file to perform dependency calculation at "build time". This currently supports compilers/tools that generate .d files either as a side-effect of tool invocation, or as a separate step that is invoked immediately before or after the tool invocation. TYPE_PREBUILD_COMMANDS indicates that a separate build step is invoked, prior to the the normal build steps, to update the dependency information. These commands are added to the build file to perform dependency calculation at "build time". Note that this step will be invoked every time a build is done in order to determine if dependency files need to be re-generated.

Specified by:
getCalculatorType in interface IManagedDependencyGeneratorType
Returns:
int

getDependencyFileExtension

public java.lang.String getDependencyFileExtension(IConfiguration buildContext,
                                                   ITool tool)
Description copied from interface: IManagedDependencyGenerator2
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.

Specified by:
getDependencyFileExtension in interface IManagedDependencyGenerator2
Parameters:
buildContext - The IConfiguration that contains the context of the build
tool - The tool associated with the dependency generator.
Returns:
String

getDependencySourceInfo

public IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source,
                                                      IBuildObject buildContext,
                                                      ITool tool,
                                                      org.eclipse.core.runtime.IPath topBuildDirectory)
Description copied from interface: IManagedDependencyGenerator2
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.

Specified by:
getDependencySourceInfo in interface IManagedDependencyGenerator2
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

getDependencySourceInfo

public IManagedDependencyInfo getDependencySourceInfo(org.eclipse.core.runtime.IPath source,
                                                      org.eclipse.core.resources.IResource resource,
                                                      IBuildObject buildContext,
                                                      ITool tool,
                                                      org.eclipse.core.runtime.IPath topBuildDirectory)
Description copied from interface: IManagedDependencyGenerator2
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.

Specified by:
getDependencySourceInfo in interface IManagedDependencyGenerator2
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

postProcessDependencyFile

public boolean postProcessDependencyFile(org.eclipse.core.runtime.IPath dependencyFile,
                                         IConfiguration buildContext,
                                         ITool tool,
                                         org.eclipse.core.runtime.IPath topBuildDirectory)
Description copied from interface: IManagedDependencyGenerator2
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.

Specified by:
postProcessDependencyFile in interface IManagedDependencyGenerator2
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