|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task net.sf.antcontrib.cpptasks.CCTask
public class CCTask
Compile and link task.
This task can compile various source languages and produce executables, shared libraries (aka DLL's) and static libraries. Compiler adaptors are currently available for several C/C++ compilers, FORTRAN, MIDL and Windows Resource files.
Copyright (c) 2001-2008, The Ant-Contrib project.
Licensed under the Apache Software License 2.0, http://www.apache.org/licenses/LICENSE-2.0.
For use with Apache Ant 1.5 or later. This software is not a product of the of the Apache Software Foundation and no endorsement is implied.
THIS SOFTWARE IS PROVIDED 'AS-IS', See http://www.apache.org/licenses/LICENSE-2.0 for additional disclaimers.
To use:
Field Summary | |
---|---|
protected boolean |
failOnError
If true, stop build on compile failure. |
Fields inherited from class org.apache.tools.ant.Task |
---|
description, location, target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
---|
project |
Constructor Summary | |
---|---|
CCTask()
|
Method Summary | |
---|---|
void |
addConfiguredCompiler(CompilerDef compiler)
Adds a compiler definition or reference. |
void |
addConfiguredCompilerArg(CompilerArgument arg)
Adds a compiler command-line arg. |
void |
addConfiguredDefineset(DefineSet defs)
Adds a defineset. |
void |
addConfiguredDistributer(DistributerDef distributer)
Adds a distributer definition or reference (Non-functional prototype). |
void |
addConfiguredLinker(LinkerDef linker)
Adds a linker definition. |
void |
addConfiguredLinkerArg(LinkerArgument arg)
Adds a linker command-line arg. |
void |
addConfiguredTarget(TargetDef target)
Adds a target definition or reference (Non-functional prototype). |
void |
addConfiguredVersioninfo(VersionInfo newVersionInfo)
Adds desriptive version information to be included in the generated file. |
void |
addEnv(org.apache.tools.ant.types.Environment.Variable var)
Add an environment variable to the launched process. |
void |
addFileset(ConditionalFileSet srcSet)
Adds a source file set. |
void |
addLibset(LibrarySet libset)
Adds a library set. |
void |
addProject(ProjectDef projectDef)
Specifies the generation of IDE project file. |
void |
addSyslibset(SystemLibrarySet libset)
Adds a system library set. |
protected int |
checkForChangedIncludeFiles(java.util.Hashtable targets)
Checks all targets that are not forced to be rebuilt or are missing object files to be checked for modified include files |
protected LinkerConfiguration |
collectExplicitObjectFiles(java.util.Vector objectFiles,
java.util.Vector sysObjectFiles,
VersionInfo versionInfo)
|
IncludePath |
createIncludePath()
Adds an include path. |
PrecompileDef |
createPrecompile()
Specifies precompilation prototype file and exclusions. |
SystemIncludePath |
createSysIncludePath()
Adds a system include path. |
void |
execute()
Executes the task. |
java.lang.String |
getDataset()
Gets the dataset. |
boolean |
getDebug()
Gets debug state. |
boolean |
getFailonerror()
Gets the failonerror flag. |
protected TargetHistoryTable |
getLinkHistory(TargetHistoryTable objHistory)
|
protected TargetInfo |
getLinkTarget(LinkerConfiguration linkerConfig,
java.util.Vector objectFiles,
java.util.Vector sysObjectFiles,
java.util.Hashtable compileTargets,
VersionInfo versionInfo)
|
java.io.File |
getObjdir()
|
java.io.File |
getOutfile()
|
java.lang.String |
getOuttype()
Gets output type. |
java.lang.String |
getSubsystem()
Gets subsystem name. |
TargetDef |
getTargetPlatform()
|
static java.util.Hashtable |
getTargetsToBuildByConfiguration(java.util.Hashtable targets)
Builds a Hashtable to targets needing to be rebuilt keyed by compiler configuration |
void |
setClassname(java.lang.String classname)
Sets the default compiler adapter. |
void |
setDataset(java.lang.String dataset)
Sets the dataset for OS/390 builds. |
void |
setDebug(boolean debug)
Enables or disables generation of debug info. |
void |
setDependencyDepth(int depth)
Deprecated. |
void |
setExceptions(boolean exceptions)
Enables generation of exception handling code |
void |
setFailonerror(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true. |
void |
setIncremental(boolean incremental)
Enables or disables incremental linking. |
void |
setLibtool(boolean libtool)
Set use of libtool. |
void |
setLink(OutputTypeEnum outputType)
Deprecated. |
void |
setMultithreaded(boolean multi)
Enables or disables generation of multithreaded code |
void |
setName(CompilerEnum name)
Sets type of the default compiler and linker. |
void |
setNewenvironment(boolean newenv)
Do not propagate old environment when new environment variables are specified. |
void |
setObjdir(java.io.File dir)
Sets the destination directory for object files. |
void |
setOptimize(OptimizationEnum optimization)
Sets optimization. |
void |
setOutfile(java.io.File outfile)
Sets the output file name. |
void |
setOutputFileProperty(java.lang.String outputFileProperty)
Specifies the name of a property to set with the physical filename that is produced by the linker |
void |
setOuttype(OutputTypeEnum outputType)
Sets the output file type. |
void |
setProject(org.apache.tools.ant.Project project)
Sets the project. |
void |
setProjectsOnly(boolean value)
|
void |
setRebuild(boolean rebuildAll)
If set to true, all files will be rebuilt. |
void |
setRelentless(boolean relentless)
If set to true, compilation errors will not stop the task until all files have been attempted. |
void |
setRtti(boolean rtti)
Enables run-time type information. |
void |
setRuntime(RuntimeType rtlType)
Sets the type of runtime library, possible values "dynamic", "static". |
void |
setSubsystem(SubsystemEnum subsystem)
Sets the nature of the subsystem under which that the program will execute. |
void |
setWarnings(WarningLevelEnum level)
Enumerated attribute with the values "none", "severe", "default", "production", "diagnostic", and "aserror". |
Methods inherited from class org.apache.tools.ant.Task |
---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
---|
getProject |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean failOnError
Constructor Detail |
---|
public CCTask()
Method Detail |
---|
public static java.util.Hashtable getTargetsToBuildByConfiguration(java.util.Hashtable targets)
public void addConfiguredCompiler(CompilerDef compiler)
compiler
- compiler
java.lang.NullPointerException
- if compiler is nullpublic void addConfiguredCompilerArg(CompilerArgument arg)
public void addConfiguredDefineset(DefineSet defs)
defs
- Define setpublic void addConfiguredLinker(LinkerDef linker)
linker
- linker
java.lang.NullPointerException
- if linker is nullpublic void addConfiguredLinkerArg(LinkerArgument arg)
public void addEnv(org.apache.tools.ant.types.Environment.Variable var)
public void addFileset(ConditionalFileSet srcSet)
public void addLibset(LibrarySet libset)
libset
- library set
java.lang.NullPointerException
- if libset is null.public void addSyslibset(SystemLibrarySet libset)
libset
- library set
java.lang.NullPointerException
- if libset is null.public void addProject(ProjectDef projectDef)
projectDef
- project file generation specificationpublic void setProjectsOnly(boolean value)
protected int checkForChangedIncludeFiles(java.util.Hashtable targets)
protected LinkerConfiguration collectExplicitObjectFiles(java.util.Vector objectFiles, java.util.Vector sysObjectFiles, VersionInfo versionInfo)
public IncludePath createIncludePath()
public PrecompileDef createPrecompile() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
public SystemIncludePath createSysIncludePath()
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if someting goes wrong with the buildpublic java.lang.String getDataset()
protected TargetHistoryTable getLinkHistory(TargetHistoryTable objHistory)
protected TargetInfo getLinkTarget(LinkerConfiguration linkerConfig, java.util.Vector objectFiles, java.util.Vector sysObjectFiles, java.util.Hashtable compileTargets, VersionInfo versionInfo)
public java.io.File getObjdir()
public java.io.File getOutfile()
public TargetDef getTargetPlatform()
public void setClassname(java.lang.String classname)
classname
- fully qualified classname which implements CompilerAdapterpublic void setDataset(java.lang.String dataset)
dataset
- The dataset to setpublic void setDebug(boolean debug)
public boolean getDebug()
public void setDependencyDepth(int depth)
public void setExceptions(boolean exceptions)
public void setRtti(boolean rtti)
public void setIncremental(boolean incremental)
incremental
- new statepublic void setLibtool(boolean libtool)
libtool
- If true, use libtool.public void setLink(OutputTypeEnum outputType)
public void setMultithreaded(boolean multi)
multi
- If true, generated code may be multithreaded.public void setName(CompilerEnum name)
gcc (default) | GCC C++ compiler |
g++ | GCC C++ compiler |
c++ | GCC C++ compiler |
g77 | GNU FORTRAN compiler |
msvc | Microsoft Visual C++ |
bcc | Borland C++ Compiler |
msrc | Microsoft Resource Compiler |
brc | Borland Resource Compiler |
df | Compaq Visual Fortran Compiler |
midl | Microsoft MIDL Compiler |
icl | Intel C++ compiler for Windows (IA-32) |
ecl | Intel C++ compiler for Windows (IA-64) |
icc | Intel C++ compiler for Linux (IA-32) |
ecc | Intel C++ compiler for Linux (IA-64) |
CC | Sun ONE C++ compiler |
aCC | HP aC++ C++ Compiler |
os390 | OS390 C Compiler |
os400 | Icc Compiler |
sunc89 | Sun C89 C Compiler |
xlC | VisualAge C Compiler |
uic | Qt user interface compiler (creates .h, .cpp and moc_*.cpp files). |
moc | Qt meta-object compiler |
xpidl | Mozilla xpidl compiler (creates .h and .xpt files). |
wcl | OpenWatcom C/C++ compiler |
wfl | OpenWatcom FORTRAN compiler |
public void setNewenvironment(boolean newenv)
public void setObjdir(java.io.File dir)
dir
- object directorypublic void setOutfile(java.io.File outfile)
outfile
- output file namepublic void setOutputFileProperty(java.lang.String outputFileProperty)
public void setOuttype(OutputTypeEnum outputType)
public java.lang.String getOuttype()
public void setProject(org.apache.tools.ant.Project project)
setProject
in class org.apache.tools.ant.ProjectComponent
public void setRebuild(boolean rebuildAll)
rebuildAll
- If true, all files will be rebuilt. If false, up to
date files will not be rebuilt.public void setRelentless(boolean relentless)
relentless
- If true, don't stop on the first compilation errorpublic void setRuntime(RuntimeType rtlType)
public void setSubsystem(SubsystemEnum subsystem)
gui | Graphical User Interface |
console | Command Line Console |
other | Other |
subsystem
- subsystem
java.lang.NullPointerException
- if subsystem is nullpublic java.lang.String getSubsystem()
public void setWarnings(WarningLevelEnum level)
public void setFailonerror(boolean fail)
fail
- if true halt the build on failurepublic boolean getFailonerror()
public void addConfiguredTarget(TargetDef target)
target
- target
java.lang.NullPointerException
- if compiler is nullpublic void addConfiguredDistributer(DistributerDef distributer)
distributer
- distributer
java.lang.NullPointerException
- if compiler is nullpublic void setOptimize(OptimizationEnum optimization)
optimization
- public void addConfiguredVersioninfo(VersionInfo newVersionInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |