Logo Search packages:      
Sourcecode: nant version File versions  Download package

NAnt::VisualCpp::Tasks::ClTask Class Reference

Inheritance diagram for NAnt::VisualCpp::Tasks::ClTask:

NAnt::Core::Tasks::ExternalProgramBase NAnt::Core::Task NAnt::Core::Element

List of all members.

Detailed Description

Compiles C/C++ programs using cl.exe, Microsoft's C/C++ compiler.

This task is intended for version 13.00.9466 of cl.exe.

Compiles helloworld.cpp for the Common Language Runtime.

        <cl outputdir="build" options="/clr">
                <include name="helloworld.cpp" />

Definition at line 63 of file ClTask.cs.

Public Types

enum  PrecompiledHeaderMode { Create = 1, AutoCreate = 2, Use = 0 }
 Defines the supported modes for the use of precompiled header files. More...

Public Member Functions

 ClTask ()
 Initializes a new instance of the ClTask class.
void Execute ()
 Executes the task unless it is skipped.
void Initialize (XmlNode elementNode)
 Performs default initialization.
void InitializeTaskConfiguration ()
 Initializes the configuration of the task using configuration settings retrieved from the NAnt configuration file.
bool IsLogEnabledFor (Level messageLevel)
 Determines whether build output is enabled for the given Level.
override void Log (Level messageLevel, string message, params object[] args)
 Logs a formatted message with the given priority.
override void Log (Level messageLevel, string message)
 Logs a message with the given priority.

Static Public Member Functions

static Element InitializeBuildElement (Element parent, XmlNode childNode, Element buildElement, Type elementType)
static string QuoteArgumentValue (string value)
 Quotes an argument value and duplicates trailing backslahes.

Public Attributes

const int UnknownExitCode = -1000
 Defines the exit code that will be returned by ExitCode if the process could not be started, or did not exit (in time).

Protected Member Functions

void CopyTo (Element clone)
 Copies all instance data of the Element to a given Element.
override void ExecuteTask ()
 Compiles the sources.
XmlNode GetAttributeConfigurationNode (FrameworkInfo framework, string attributeName)
 Locates the XML node for the specified attribute in the project configuration node.
override void InitializeElement (XmlNode elementNode)
 <note>Deprecated (to be deleted).</note>
virtual void InitializeTask (XmlNode taskNode)
 Initializes the task.
virtual void InitializeXml (XmlNode elementNode, PropertyDictionary properties, FrameworkInfo framework)
 Initializes all build attributes and child elements.
virtual bool NeedsCompiling ()
 Determines if the sources need to be compiled.
virtual void PrepareProcess (Process process)
 Updates the ProcessStartInfo of the specified Process.
virtual Process StartProcess ()
 Starts the process and handles errors.


virtual ArgumentCollection Arguments [get]
 The command-line arguments for the external program.
virtual DirectoryInfo BaseDirectory [get, set]
 Gets the working directory for the application.
CharacterSet CharacterSet [get, set]
 Tells the compiler to use the specified character set.
string CommandLine [get]
 Gets the command-line arguments, separated by spaces.
virtual bool CustomXmlProcessing [get]
 Gets a value indicating whether the element is performing additional processing using the XmlNode that was used to initialize the element.
OptionCollection Defines [get]
 Macro definitions to pass to cl.exe. Each entry will generate a /D.
virtual TextWriter ErrorWriter [get, set]
 Gets or sets the TextWriter to which error output of the external program will be written.
virtual string ExeName [get, set]
 The name of the executable that should be used to launch the external program.
int ExitCode [get]
 Gets the value that the process specified when it terminated.
bool FailOnError [get, set]
 Determines if task failure stops the build, or is just reported. The default is .
FileSet ForcedUsingFiles [get, set]
 Specifies metadata files to reference in this compilation as an alternative to passing a file name to using in source code.
bool IfDefined [get, set]
 If then the task will be executed; otherwise, skipped. The default is .
FileSet IncludeDirs [get, set]
 The list of directories in which to search for include files.
virtual Location Location [get, set]
 Gets or sets the location in the build file where the element is defined.
string LogPrefix [get]
 The prefix used when sending messages to the log.
bool ManagedExtensions [get, set]
 Specifies whether Managed Extensions for C++ should be enabled. The default is .
FileSet MetaDataIncludeDirs [get, set]
 Directories that the compiler will search to resolve file references passed to the using directive.
override string Name [get]
 The name of the task.
XmlNamespaceManager NamespaceManager [get, set]
 Gets or sets the XmlNamespaceManager.
string ObjectFile [get, set]
 A name to override the default object file name; can be either a file or directory name. The default is the output directory.
string Options [get, set]
 Options to pass to the compiler.
virtual FileInfo Output [get, set]
 Gets the file to which the standard output should be redirected.
virtual bool OutputAppend [get, set]
 Gets a value indicating whether output will be appended to the Output.
DirectoryInfo OutputDir [get, set]
 Directory where all output files are placed.
virtual TextWriter OutputWriter [get, set]
 Gets or sets the TextWriter to which standard output messages of the external program will be written.
object Parent [get, set]
 Gets or sets the parent of the element.
string PchFile [get, set]
 Specifies the path and/or name of the generated precompiled header file - given either relative to OutputDir or as an absolute path.
PrecompiledHeaderMode PchMode [get, set]
 The mode in which the specified PchFile (if any) is used. The default is PrecompiledHeaderMode.Use.
string PchThroughFile [get, set]
 The path of the boundary file when generating/using the specified PchFile. If a precompiled header file is not specified then this attribute is ignored.
override string ProgramArguments [get]
 Gets the command-line arguments for the external program.
string ProgramDatabaseFile [get, set]
 A name for the compiler-generated PDB file; can be either a file or directory name. The default is the output directory.
override string ProgramFileName [get]
 Gets the filename of the external program to start.
virtual Project Project [get, set]
 Gets or sets the Project to which this element belongs.
virtual PropertyDictionary Properties [get]
 Gets the properties local to this Element and the Project.
FileSet Sources [get, set]
 The list of files to compile.
Level Threshold [get, set]
 Gets or sets the log threshold for this Task. By default the threshold of a task matches the threshold of the project.
int TimeOut [get, set]
 The maximum amount of time the application is allowed to execute, expressed in milliseconds. Defaults to no time-out.
OptionCollection Undefines [get]
 Macro undefines (/U) to pass to cl.exe.
bool UnlessDefined [get, set]
 Opposite of IfDefined. If then the task will be executed; otherwise, skipped. The default is .
virtual bool UseRuntimeEngine [get, set]
 Specifies whether the external program should be executed using a runtime engine, if configured. The default is .
bool Verbose [get, set]
 Determines whether the task should report detailed build log messages. The default is .
virtual XmlNode XmlNode [get, set]
 Gets or sets the XML node of the element.

Private Member Functions

bool AreObjsUpToDate ()
string FindUpdatedInclude (string srcFileName, DateTime objLastWriteTime)
 Determines whether any file that are includes in the specified source file has been updated after the obj was compiled.
bool IsObjUpToDate (string srcFileName)
bool IsPchfileUpToDate ()
 Determines whether the precompiled header file is up-to-date.

Private Attributes

CharacterSet _characterSet = CharacterSet.NotSet
OptionCollection _defines = new OptionCollection()
FileSet _forcedUsingFiles = new FileSet()
FileSet _includeDirs = new FileSet()
Regex _includeRegex
bool _managedExtensions
FileSet _metaDataIncludeDirs = new FileSet()
string _objectFile
string _options
DirectoryInfo _outputDir
string _pchFile
string _pchThroughFile
string _pdbFile
PrecompiledHeaderMode _precompileHeaderMode = PrecompiledHeaderMode.Use
Hashtable _resolvedIncludes
string _responseFileName
FileSet _sources = new FileSet()
OptionCollection _undefines = new OptionCollection()

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index