net.sf.antcontrib.cpptasks.compiler

Class AbstractLinker

Implemented Interfaces:
Cloneable, Linker, Processor
Known Direct Subclasses:
CommandLineLinker

public abstract class AbstractLinker
extends AbstractProcessor
implements Linker

An abstract Linker implementation.
Author:
Adam Murdoch

Field Summary

Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID

Constructor Summary

AbstractLinker(String[] objExtensions, String[] ignoredExtensions)

Method Summary

void
addVersionFiles(VersionInfo versionInfo, LinkType linkType, File outputFile, boolean isDebug, File objDir, TargetMatcher matcher)
Adds source or object files to the bidded fileset to support version information.
int
bid(String inputFile)
Returns the bid of the processor for the file.
Processor
changeEnvironment(boolean newEnvironment, Environment env)
protected abstract LinkerConfiguration
createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, LinkerDef specificConfig, TargetDef targetPlatform, VersionInfo versionInfo)
ProcessorConfiguration
createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, ProcessorDef specificConfig, TargetDef targetPlatform, VersionInfo versionInfo)
Returns the compiler configuration for or element.
String
getLibraryKey(File libfile)
Extracts the significant part of a library name to ensure there aren't collisions
abstract String[]
getOutputFileNames(String fileName, VersionInfo versionInfo)
Output file name (no path components) corresponding to source file

Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

bid, changeEnvironment, clone, getHeaderExtensions, getIdentifier, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString

Constructor Details

AbstractLinker

public AbstractLinker(String[] objExtensions,
                      String[] ignoredExtensions)

Method Details

addVersionFiles

public void addVersionFiles(VersionInfo versionInfo,
                            LinkType linkType,
                            File outputFile,
                            boolean isDebug,
                            File objDir,
                            TargetMatcher matcher)
            throws IOException
Adds source or object files to the bidded fileset to support version information.
Specified by:
addVersionFiles in interface Linker
Parameters:
versionInfo - version information
linkType - link type
isDebug - true if debug build
objDir - directory for generated files
matcher - bidded fileset

bid

public int bid(String inputFile)
Returns the bid of the processor for the file. A linker will bid 1 on any unrecognized file type.
Specified by:
bid in interface Processor
Overrides:
bid in interface AbstractProcessor
Parameters:
inputFile - filename of input file
Returns:
bid for the file, 0 indicates no interest, 1 indicates that the processor recognizes the file but doesn't process it (header files, for example), 100 indicates strong interest

changeEnvironment

public Processor changeEnvironment(boolean newEnvironment,
                                   Environment env)
Specified by:
changeEnvironment in interface Processor
Overrides:
changeEnvironment in interface AbstractProcessor

createConfiguration

protected abstract LinkerConfiguration createConfiguration(CCTask task,
                                                           LinkType linkType,
                                                           ProcessorDef[] baseConfigs,
                                                           LinkerDef specificConfig,
                                                           TargetDef targetPlatform,
                                                           VersionInfo versionInfo)

createConfiguration

public ProcessorConfiguration createConfiguration(CCTask task,
                                                  LinkType linkType,
                                                  ProcessorDef[] baseConfigs,
                                                  ProcessorDef specificConfig,
                                                  TargetDef targetPlatform,
                                                  VersionInfo versionInfo)
Returns the compiler configuration for or element.
Specified by:
createConfiguration in interface Processor
Parameters:
specificConfig - A or element.
Returns:
resulting configuration

getLibraryKey

public String getLibraryKey(File libfile)
Extracts the significant part of a library name to ensure there aren't collisions
Specified by:
getLibraryKey in interface Linker

getOutputFileNames

public abstract String[] getOutputFileNames(String fileName,
                                            VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
Specified by:
getOutputFileNames in interface Processor
Parameters:
Returns:
output file name or null if no output file or name not determined by input file

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