net.sf.antcontrib.cpptasks.compiler

Class CommandLineCompilerConfiguration

Implemented Interfaces:
CompilerConfiguration, ProcessorConfiguration

public final class CommandLineCompilerConfiguration
extends java.lang.Object
implements CompilerConfiguration

A configuration for a C++ compiler
Author:
Curt Arnold

Constructor Summary

CommandLineCompilerConfiguration(CommandLineCompiler compiler, String identifier, File[] includePath, File[] sysIncludePath, File[] envIncludePath, String includePathIdentifier, String[] args, ProcessorParam[] params, boolean rebuild, String[] endArgs)
CommandLineCompilerConfiguration(CommandLineCompilerConfiguration base, String[] additionalArgs, String[] exceptFiles, boolean isPrecompileHeaderGeneration)

Method Summary

int
bid(String inputFile)
void
compile(CCTask task, File outputDir, String[] sourceFiles, boolean relentless, ProgressMonitor monitor)
CompilerConfiguration[]
createPrecompileConfigurations(File prototype, String[] nonPrecompiledFiles)
This method may be used to get two distinct compiler configurations, one for compiling the specified file and producing a precompiled header file, and a second for compiling other files using the precompiled header file.
String
getCommand()
Compiler
getCompiler()
String[]
getEndArguments()
String
getIdentifier()
Returns a string representation of this configuration.
File[]
getIncludePath()
String
getIncludePathIdentifier()
Returns an digest for the include path for the configuration.
String[]
getOutputFileNames(String inputFile, VersionInfo versionInfo)
CompilerParam
getParam(String name)
ProcessorParam[]
getParams()
String[]
getPreArguments()
boolean
getRebuild()
boolean
isPrecompileGeneration()
DependencyInfo
parseIncludes(CCTask task, File baseDir, File source)
String
toString()

Constructor Details

CommandLineCompilerConfiguration

public CommandLineCompilerConfiguration(CommandLineCompiler compiler,
                                        String identifier,
                                        File[] includePath,
                                        File[] sysIncludePath,
                                        File[] envIncludePath,
                                        String includePathIdentifier,
                                        String[] args,
                                        ProcessorParam[] params,
                                        boolean rebuild,
                                        String[] endArgs)

CommandLineCompilerConfiguration

public CommandLineCompilerConfiguration(CommandLineCompilerConfiguration base,
                                        String[] additionalArgs,
                                        String[] exceptFiles,
                                        boolean isPrecompileHeaderGeneration)

Method Details

bid

public int bid(String inputFile)
Specified by:
bid in interface ProcessorConfiguration

compile

public void compile(CCTask task,
                    File outputDir,
                    String[] sourceFiles,
                    boolean relentless,
                    ProgressMonitor monitor)
            throws BuildException
Specified by:
compile in interface CompilerConfiguration

createPrecompileConfigurations

public CompilerConfiguration[] createPrecompileConfigurations(File prototype,
                                                              String[] nonPrecompiledFiles)
This method may be used to get two distinct compiler configurations, one for compiling the specified file and producing a precompiled header file, and a second for compiling other files using the precompiled header file. The last (preferrably only) include directive in the prototype file will be used to mark the boundary between pre-compiled and normally compiled headers.
Specified by:
createPrecompileConfigurations in interface CompilerConfiguration
Parameters:
prototype - A source file (for example, stdafx.cpp) that is used to build the precompiled header file. @returns null if precompiled headers are not supported or a two element array containing the precompiled header generation configuration and the consuming configuration

getCommand

public String getCommand()

getCompiler

public Compiler getCompiler()

getEndArguments

public String[] getEndArguments()

getIdentifier

public String getIdentifier()
Returns a string representation of this configuration. Should be canonical so that equivalent configurations will have equivalent string representations
Specified by:
getIdentifier in interface ProcessorConfiguration

getIncludePath

public File[] getIncludePath()

getIncludePathIdentifier

public String getIncludePathIdentifier()
Returns an digest for the include path for the configuration. This is used to determine if cached dependency information is invalid because the include paths have changed
Specified by:
getIncludePathIdentifier in interface CompilerConfiguration

getOutputFileNames

public String[] getOutputFileNames(String inputFile,
                                   VersionInfo versionInfo)
Specified by:
getOutputFileNames in interface ProcessorConfiguration

getParam

public CompilerParam getParam(String name)
Specified by:
getParam in interface CompilerConfiguration

getParams

public ProcessorParam[] getParams()
Specified by:
getParams in interface ProcessorConfiguration

getPreArguments

public String[] getPreArguments()

getRebuild

public boolean getRebuild()
Specified by:
getRebuild in interface ProcessorConfiguration

isPrecompileGeneration

public boolean isPrecompileGeneration()
Specified by:
isPrecompileGeneration in interface CompilerConfiguration

parseIncludes

public DependencyInfo parseIncludes(CCTask task,
                                    File baseDir,
                                    File source)
Specified by:
parseIncludes in interface CompilerConfiguration

toString

public String toString()

Copyright B) 2001-2006 Ant-Contrib project. All Rights Reserved.