net.sf.antcontrib.cpptasks
public class CCTask extends 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. |
| 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(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(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(Vector objectFiles, 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. |
| 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, Vector objectFiles, Vector sysObjectFiles, Hashtable compileTargets, VersionInfo versionInfo) |
| File | getObjdir() |
| File | getOutfile() |
| String | getOuttype()
Gets output type. |
| String | getSubsystem()
Gets subsystem name. |
| TargetDef | getTargetPlatform() |
| static Hashtable | getTargetsToBuildByConfiguration(Hashtable targets)
Builds a Hashtable to targets needing to be rebuilt keyed by compiler
configuration |
| void | setClassname(String classname)
Sets the default compiler adapter. |
| void | setDataset(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)
Sets the output file type. |
| 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(File dir)
Sets the destination directory for object files.
|
| void | setOptimize(OptimizationEnum optimization)
Sets optimization. |
| void | setOutfile(File outfile)
Sets the output file name. |
| void | setOutputFileProperty(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(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". |
Parameters: compiler compiler
Throws: NullPointerException if compiler is null
Parameters: defs Define set
Parameters: distributer distributer
Throws: NullPointerException if compiler is null
Parameters: linker linker
Throws: NullPointerException if linker is null
Parameters: target target
Throws: NullPointerException if compiler is null
Parameters: libset library set
Throws: NullPointerException if libset is null.
Parameters: projectDef project file generation specification
Parameters: libset library set
Throws: NullPointerException if libset is null.
Returns: total number of targets to be rebuilt
Throws: BuildException if someting goes wrong with the build
Returns: Returns a String
Returns: true if building for debugging
Returns: the failonerror flag
Returns: output type
Returns: Subsystem name
Parameters: classname fully qualified classname which implements CompilerAdapter
Parameters: dataset The dataset to set
Parameters: fail if true halt the build on failure
Parameters: incremental new state
Parameters: libtool If true, use libtool.
Deprecated:
Sets the output file type. Supported values "executable", "shared", and "static". Deprecated, specify outtype instead.Parameters: multi If true, generated code may be multithreaded.
| 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 |
Parameters: dir object directory
Parameters: optimization
Parameters: outfile output file name
Parameters: rebuildAll If true, all files will be rebuilt. If false, up to date files will not be rebuilt.
Parameters: relentless If true, don't stop on the first compilation error
| gui | Graphical User Interface |
| console | Command Line Console |
| other | Other |
Parameters: subsystem subsystem
Throws: NullPointerException if subsystem is null