net.sf.antcontrib.cpptasks.compiler
Class AbstractLinker

java.lang.Object
  extended by net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
      extended by net.sf.antcontrib.cpptasks.compiler.AbstractLinker
All Implemented Interfaces:
java.lang.Cloneable, Linker, Processor
Direct Known 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(java.lang.String[] objExtensions, java.lang.String[] ignoredExtensions)
           
 
Method Summary
 void addVersionFiles(VersionInfo versionInfo, LinkType linkType, java.io.File outputFile, boolean isDebug, java.io.File objDir, TargetMatcher matcher)
          Adds source or object files to the bidded fileset to support version information.
 int bid(java.lang.String inputFile)
          Returns the bid of the processor for the file.
 Processor changeEnvironment(boolean newEnvironment, org.apache.tools.ant.types.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.
 java.lang.String getLibraryKey(java.io.File libfile)
          Extracts the significant part of a library name to ensure there aren't collisions
abstract  java.lang.String[] getOutputFileNames(java.lang.String fileName, VersionInfo versionInfo)
          Output file name (no path components) corresponding to source file
 
Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor
clone, getHeaderExtensions, getIdentifier, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.antcontrib.cpptasks.compiler.Linker
getLibraryPath, getLibraryPatterns, getLinker, isCaseSensitive
 
Methods inherited from interface net.sf.antcontrib.cpptasks.compiler.Processor
getIdentifier
 

Constructor Detail

AbstractLinker

public AbstractLinker(java.lang.String[] objExtensions,
                      java.lang.String[] ignoredExtensions)
Method Detail

bid

public int bid(java.lang.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 class 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,
                                   org.apache.tools.ant.types.Environment env)
Specified by:
changeEnvironment in interface Processor
Overrides:
changeEnvironment in class 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)
Description copied from interface: Processor
Returns the compiler configuration for or element.

Specified by:
createConfiguration in interface Processor
baseConfigs - When specificConfig corresponds to a or linker element, defaultProvider will be a zero to two element array. If there is an extends attribute, the first element will be the referenced ProcessorDef, unless inherit = false, the last element will be the containing element
specificConfig - A or element.
Returns:
resulting configuration

getLibraryKey

public java.lang.String getLibraryKey(java.io.File libfile)
Description copied from interface: Linker
Extracts the significant part of a library name to ensure there aren't collisions

Specified by:
getLibraryKey in interface Linker

getOutputFileNames

public abstract java.lang.String[] getOutputFileNames(java.lang.String fileName,
                                                      VersionInfo versionInfo)
Description copied from interface: Processor
Output file name (no path components) corresponding to source file

Specified by:
getOutputFileNames in interface Processor
Parameters:
fileName - input file
Returns:
output file name or null if no output file or name not determined by input file

addVersionFiles

public void addVersionFiles(VersionInfo versionInfo,
                            LinkType linkType,
                            java.io.File outputFile,
                            boolean isDebug,
                            java.io.File objDir,
                            TargetMatcher matcher)
                     throws java.io.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
outputFile - name of generated executable
objDir - directory for generated files
matcher - bidded fileset
Throws:
java.io.IOException


Copyright © 2001-2008 Ant-Contrib Project. All Rights Reserved.