net.sf.antcontrib.cpptasks
Class CompilerDef

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.types.DataType
              |
              +--net.sf.antcontrib.cpptasks.ProcessorDef
                    |
                    +--net.sf.antcontrib.cpptasks.CompilerDef

public final class CompilerDef
extends ProcessorDef

A compiler definition. compiler elements may be placed either as children of a cc element or the project element. A compiler element with an id attribute may be referenced from compiler elements with refid or extends attributes.

Author:
Adam Murdoch

Inner Class Summary
static class CompilerDef.WarningLevel
          Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "failtask".
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, description, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
CompilerDef()
           
 
Method Summary
 void addConfiguredCompilerArg(CompilerArgument arg)
          Adds a compiler command-line arg.
 void addConfiguredDefineset(DefineSet defs)
          Adds a defineset.
 IncludePath createIncludePath()
          Creates an include path.
 PrecompileDef createPrecompile()
          Specifies precompilation prototype file and exclusions.
 SystemIncludePath createSysIncludePath()
          Creates a system include path.
 void execute()
           
 UndefineArgument[] getActiveDefines()
           
 java.lang.String[] getActiveIncludePaths()
          Returns the compiler-specific include path.
 PrecompileDef getActivePrecompile(CompilerDef ccElement)
           
 java.lang.String[] getActiveSysIncludePaths()
           
 boolean getExceptions(CompilerDef[] defaultProviders, int index)
           
 boolean getMultithreaded(CompilerDef[] defaultProviders, int index)
           
 Processor getProcessor()
          Obtains the appropriate processor (compiler, linker)
 int getWarnings(CompilerDef[] defaultProviders, int index)
           
 void setClassname(java.lang.String classname)
          Sets the default compiler adapter.
 void setExceptions(boolean exceptions)
          Enables or disables exception support.
 void setMultithreaded(boolean multithreaded)
          Enables or disables generation of multithreaded code.
 void setName(CompilerEnum name)
          Sets compiler type.
protected  void setProcessor(Processor proc)
          Sets the processor
 void setWarnings(CompilerDef.WarningLevel level)
          Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "failtask".
 
Methods inherited from class net.sf.antcontrib.cpptasks.ProcessorDef
addConfiguredProcessorArg, addFileset, booleanValueOf, createConfiguration, getActiveProcessorArgs, getDebug, getDefaultProviders, getExtends, getInherit, getLibtool, getRebuild, hasFileSets, isActive, setDebug, setDescription, setExtends, setId, setIf, setInherit, setLibtool, setRebuild, setRefid, setUnless, visitFiles
 
Methods inherited from class org.apache.tools.ant.types.DataType
circularReference, dieOnCircularReference, getCheckedRef, getDescription, isReference, noChildrenAllowed, tooManyAttributes
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompilerDef

public CompilerDef()
Method Detail

getProcessor

public Processor getProcessor()
Description copied from class: ProcessorDef
Obtains the appropriate processor (compiler, linker)
Overrides:
getProcessor in class ProcessorDef
Tags copied from class: ProcessorDef
Returns:
processor

createPrecompile

public PrecompileDef createPrecompile()
                               throws org.apache.tools.ant.BuildException
Specifies precompilation prototype file and exclusions.

getActivePrecompile

public PrecompileDef getActivePrecompile(CompilerDef ccElement)

addConfiguredCompilerArg

public void addConfiguredCompilerArg(CompilerArgument arg)
Adds a compiler command-line arg.

addConfiguredDefineset

public void addConfiguredDefineset(DefineSet defs)
Adds a defineset.

createIncludePath

public IncludePath createIncludePath()
Creates an include path.

createSysIncludePath

public SystemIncludePath createSysIncludePath()
Creates a system include path. Locations and timestamps of files located using the system include paths are not used in dependency analysis. Standard include locations should not be specified. The compiler adapters should recognized the settings from the appropriate environment variables or configuration files.

getActiveIncludePaths

public java.lang.String[] getActiveIncludePaths()
Returns the compiler-specific include path.

getActiveSysIncludePaths

public java.lang.String[] getActiveSysIncludePaths()

setMultithreaded

public void setMultithreaded(boolean multithreaded)
Enables or disables generation of multithreaded code. Unless specified, multithreaded code generation is enabled.
Parameters:
multi - If true, generated code may be multithreaded.

getMultithreaded

public boolean getMultithreaded(CompilerDef[] defaultProviders,
                                int index)

setExceptions

public void setExceptions(boolean exceptions)
Enables or disables exception support.
Parameters:
exceptions - if true, exceptions are supported.

getExceptions

public final boolean getExceptions(CompilerDef[] defaultProviders,
                                   int index)

setName

public void setName(CompilerEnum name)
             throws org.apache.tools.ant.BuildException
Sets compiler type. Supported compilers
gcc (default)GCC C++ compiler
g++GCC C++ compiler
c++GCC C++ compiler
msvcMicrosoft Visual C++
bccBorland C++ Compiler
msrcMicrosoft Resource Compiler
brcBorland Resource Compiler
dfCompaq Visual Fortran Compiler
midlMicrosoft MIDL Compiler
iclIntel C++ compiler for Windows (IA-32)
eclIntel C++ compiler for Windows (IA-64)
iccIntel C++ compiler for Linux (IA-32)
eccIntel C++ compiler for Linux (IA-64)
CCSun ONE C++ compiler
aCCHP aC++ C++ Compiler
os390OS390 C Compiler
os400Icc Compiler
sunc89Sun C89 C Compiler
xlCVisualAge C Compiler

setClassname

public void setClassname(java.lang.String classname)
                  throws org.apache.tools.ant.BuildException
Sets the default compiler adapter. Use the "name" attribute when the compiler is a supported compiler.
Overrides:
setClassname in class ProcessorDef
Parameters:
classname - fully qualified classname which implements CompilerAdapter

setProcessor

protected void setProcessor(Processor proc)
                     throws org.apache.tools.ant.BuildException
Description copied from class: ProcessorDef
Sets the processor
Overrides:
setProcessor in class ProcessorDef
Tags copied from class: ProcessorDef
Parameters:
processor - processor, may not be null.
Throws:
org.apache.tools.ant.BuildException - if ProcessorDef is a reference
java.lang.NullPointerException - if processor is null

getActiveDefines

public UndefineArgument[] getActiveDefines()

setWarnings

public void setWarnings(CompilerDef.WarningLevel level)
Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "failtask".

getWarnings

public int getWarnings(CompilerDef[] defaultProviders,
                       int index)

execute

public void execute()
             throws org.apache.tools.ant.BuildException


Copyright © 2001-2002 Ant-Contrib project. All Rights Reserved.