Nant参考手册

Task Reference

TaskSummary
alWraps al.exe, the assembly linker for the .NET Framework.
asminfoGenerates an AssemblyInfo file using the attributes given.
attribChanges the file attributes of a file or set of files and directories.
available Checks if a resource is available at runtime.
aximpGenerates a Windows Forms Control that wraps ActiveX Controls defined in an OCX.
callCalls a NAnt target in the current project.
choose

Executes an alternate set of task or type definition depending on conditions that are individually set on each group.

clCompiles C/C++ programs using cl.exe, Microsoft's C/C++ compiler.
copyCopies a file, a directory, or set of files to a new file or directory.
cscCompiles C# programs.
cvsExecutes the cvs command specified by the command attribute.
cvs-changelogProduces an XML report that represents the cvs changes from the given start day, to a given end date.
cvs-checkoutChecks out a CVS module to the required directory.
cvs-exportExports a cvs module in preperation for a release (i.e. the CVS version folders are not exported).
cvs-passExecutes the cvs login command which appends or updates an entry to the specified .cvspass file.
cvs-rtagTags all sources in the remote repository with a given tag.
cvs-tagTags all local sources with the specified tag.
cvs-updateUpdates a CVS module in a local working directory.
delay-signSigns delay-signed .NET Assemblies, or re-signs existing assemblies.
deleteDeletes a file, fileset or directory.
descriptionAn empty task that allows a build file to contain a description.
echoWrites a message to the build log or a specified file.
execExecutes a system command.
failExits the current build by throwing a BuildException, optionally printing additional information.
foreachLoops over a set of items.
getGets a particular file from a URL source.
gunzipExpands a file packed using GZip compression.
ifChecks the conditional attributes and executes the children if true.
ifnot The opposite of the if task.
ilasmCompiles ILASM programs.
ildasmDisassembles any portable executable (PE) file that contains intermediate language (IL) code.
includeIncludes an external build file.
jscCompiles JScript.NET programs.
libRun lib.exe, Microsoft's Library Manager.
licenseGenerates a .licence file from a .licx file.
linkLinks files using link.exe, Microsoft's Incremental Linker.
loadfileLoad a text file into a single property.
loadtasksLoads tasks form a given assembly or all assemblies in a given directory or <fileset>.
mailSends an SMTP message.
mcCompiles messages using mc.exe, Microsoft's Win32 message compiler.
midlThis tasks allows you to run MIDL.exe.
mkdirCreates a directory and any non-existent parent directory if necessary.
moveMoves a file, a directory, or set of files to a new file or directory.
nantRuns NAnt on a supplied build file, or a set of build files.
nantschemaCreates an XSD File for all available tasks.
ndocRuns NDoc V1.3.1 to create documentation.
nunit Runs tests using the NUnit V1.0 framework.
nunit2Runs tests using the NUnit V2.6 framework.
propertySets a property in the current project.
rcCompiles resources using rc.exe, Microsoft's Win32 resource compiler.
readregistryReads a value or set of values from the Windows Registry into one or more NAnt properties.
regasmRegisters an assembly, or set of assemblies for use from COM clients.
regexSets project properties based on the evaluatuion of a regular expression.
regsvcsInstalls or removes .NET Services.
resgenConverts files from one resource format to another.
scriptExecutes the code contained within the task.
servicecontrollerAllows a Windows service to be controlled.
setenvSets an environment variable or a whole collection of them. Use an empty value attribute to clear a variable.
sleepA task for sleeping a specified period of time, useful when a build or deployment process requires an interval between tasks.
solutionCompiles VS.NET solutions (or sets of projects), automatically determining project dependencies from inter-project references.
styleProcesses a document via XSLT.
sysinfoSets properties with system information.
tarCreates a tar file from the specified filesets.
tlbexpExports a .NET assembly to a type library that can be used from unmanaged code (wraps Microsoft's tlbexp.exe).
tlbimpImports a type library to a .NET assembly (wraps Microsoft's tlbimp.exe).
touchTouches a file or set of files -- corresponds to the Unix touch command.
trycatchExecutes a set of tasks, and optionally catches a build exception to allow recovery or rollback steps to be taken, or to define some steps to be taken regardless if the tasks succeed or fail, or both.
tstampSets properties with the current date and time.
untarExtracts files from a tar archive.
unzipExtracts files from a zip archive.
uptodateCheck modification dates on groups of files.
vbcCompiles Visual Basic.NET programs.
vjcCompiles Visual J# programs using vjc, Microsoft's J# compiler.
xmlpeekExtracts text from an XML file at the location specified by an XPath expression.
xmlpokeReplaces text in an XML file at the location specified by an XPath expression.
zipCreates a zip file from the specified filesets.



Type Reference

TypeSummary
assemblyfilesetSpecialized <fileset> class for managing assembly files.
categoriesControls the categories of tests to execute using the <nunit2> task.
credentialProvides credentials for password-based authentication schemes.
cvsfilesetA <cvsfileset> is a <fileset> with extra attributes useful in the context of the <cvs> task.
dirsetA specialized <fileset> used for specifying a set of directories.
filesetFilesets are groups of files. These files can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of patterns. Filesets can appear inside tasks that support this feature or at the project level, i.e., as children of <project>.
filterchainRepresent a chain of NAnt filters that can be applied to a Task.
moduleset

One or more modules to compile into an assembly.

namespaceimportsContains a collection of NamespaceImport items.
path

Paths are groups of files and/or directories that need to be passed as a single unit. The order in which parts of the path are specified in the build file is retained, and duplicate parts are automatically suppressed.

patternsetA set of patterns, mostly used to include or exclude certain files.
proxyContains HTTP proxy settings used to process requests to Internet resources.
resourcefilesetSpecialized <fileset> class for managing resource files.
tarfilesetA <tarfileset> is a <fileset> with extra attributes useful in the context of the <tar> task.
warnaserrorControls the behaviour of a compiler with regards to the reporting of warnings.
zipfilesetA <zipfileset> is a <fileset> with extra attributes useful in the context of the <zip> task.


Function Reference

 

Assembly Functions

NameSummary
assembly::get-full-nameGets the full name of the assembly, also known as the display name.
assembly::get-locationGets the physical location, in codebase format, of the loaded file that contains the manifest.
assembly::get-nameGets an AssemblyName for the specified assembly.
assembly::loadLoads an assembly given the long form of its name.
assembly::load-from-fileLoads an assembly given its file name or path.
assemblyname::get-assembly-nameGets the AssemblyName for a given file.
assemblyname::get-codebaseGets the location of the assembly as a URL.
assemblyname::get-escaped-codebaseGets the URI, including escape characters, that represents the codebase.
assemblyname::get-full-nameGets the full name of the assembly, also known as the display name.
assemblyname::get-nameGets the simple, unencrypted name of the assembly.
assemblyname::get-versionGets the version of the assembly.

Conversion Functions

NameSummary
bool::parseConverts the specified string representation of a logical value to its Boolean equivalent.
bool::to-stringConverts the specified Boolean to its equivalent string representation.
convert::to-boolean Converts the argument to a boolean
convert::to-datetime Converts the argument to a datetime.
convert::to-double Converts the argument to double
convert::to-int Converts the argument to an integer.
convert::to-string Converts the argument to a string.
datetime::format-to-stringConverts the specified DateTime to its equivalent string representation.
datetime::parseConverts the specified string representation of a date and time to its DateTime equivalent.
datetime::to-stringConverts the specified DateTime to its equivalent string representation.
double::parseConverts the specified string representation of a number to its double-precision floating point number equivalent.
double::to-stringConverts the specified Double to its equivalent string representation.
int::parseConverts the specified string representation of a number to its 32-bit signed integer equivalent.
int::to-stringConverts the specified Int32 to its equivalent string representation.
long::parseConverts the specified string representation of a number to its 64-bit signed integer equivalent.
long::to-stringConverts the specified Int64 to its equivalent string representation.
timespan::parseConstructs a TimeSpan from a time indicated by a specified string.
timespan::to-stringConverts the specified TimeSpan to its equivalent string representation.
version::parseConverts the specified string representation of a version to its Version equivalent.
version::to-stringConverts the specified Version to its equivalent string representation.

Date/Time Functions

NameSummary
datetime::get-dayGets the day of the month represented by the specified date.
datetime::get-day-of-weekGets the day of the week represented by the specified date.
datetime::get-day-of-yearGets the day of the year represented by the specified date.
datetime::get-days-in-monthReturns the number of days in the specified month of the specified year.
datetime::get-hourGets the hour component of the specified date.
datetime::get-millisecondGets the milliseconds component of the specified date.
datetime::get-minuteGets the minute component of the specified date.
datetime::get-monthGets the month component of the specified date.
datetime::get-secondGets the seconds component of the specified date.
datetime::get-ticksGets the number of ticks that represent the specified date.
datetime::get-yearGets the year component of the specified date.
datetime::is-leap-yearReturns an indication whether the specified year is a leap year.
datetime::nowGets a DateTime that is the current local date and time on this computer.
timespan::from-daysReturns a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond.
timespan::from-hoursReturns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.
timespan::from-millisecondsReturns a TimeSpan that represents a specified number of milliseconds.
timespan::from-minutesReturns a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.
timespan::from-secondsReturns a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond.
timespan::from-ticksReturns a TimeSpan that represents a specified time, where the specification is in units of ticks.
timespan::get-daysReturns the number of whole days represented by the specified TimeSpan.
timespan::get-hoursReturns the number of whole hours represented by the specified TimeSpan.
timespan::get-millisecondsReturns the number of whole milliseconds represented by the specified TimeSpan.
timespan::get-minutesReturns the number of whole minutes represented by the specified TimeSpan.
timespan::get-secondsReturns the number of whole seconds represented by the specified TimeSpan.
timespan::get-ticksReturns the number of ticks contained in the specified TimeSpan.
timespan::get-total-daysReturns the total number of days represented by the specified TimeSpan, expressed in whole and fractional days.
timespan::get-total-hoursReturns the total number of hours represented by the specified TimeSpan, expressed in whole and fractional hours.
timespan::get-total-millisecondsReturns the total number of milliseconds represented by the specified TimeSpan, expressed in whole and fractional milliseconds.
timespan::get-total-minutesReturns the total number of minutes represented by the specified TimeSpan, expressed in whole and fractional minutes.
timespan::get-total-secondsReturns the total number of seconds represented by the specified TimeSpan, expressed in whole and fractional seconds.

Directory Functions

NameSummary
directory::existsDetermines whether the given path refers to an existing directory on disk.
directory::get-creation-timeReturns the creation date and time of the specified directory.
directory::get-current-directoryGets the current working directory.
directory::get-directory-rootReturns the volume information, root information, or both for the specified path.
directory::get-last-access-timeReturns the date and time the specified directory was last accessed.
directory::get-last-write-timeReturns the date and time the specified directory was last written to.
directory::get-parent-directoryRetrieves the parent directory of the specified path.

DNS Functions

NameSummary
dns::get-host-nameGets the host name of the local computer.

Environment Functions

NameSummary
environment::get-folder-pathGets the path to the system special folder identified by the specified enumeration.
environment::get-machine-nameGets the NetBIOS name of this local computer.
environment::get-operating-systemGets an OperatingSystem object that represents the current operating system.
environment::get-user-nameGets the user name of the person who started the current thread.
environment::get-variableReturns the value of the specified environment variable.
environment::get-versionGets a Version object that describes the major, minor, build, and revision numbers of the Common Language Runtime.
environment::newlineGets the newline string defined for this environment.
environment::variable-existsGets a value indicating whether the specified environment variable exists.

File Functions

NameSummary
file::existsDetermines whether the specified file exists.
file::get-creation-timeReturns the creation date and time of the specified file.
file::get-last-access-timeReturns the date and time the specified file was last accessed.
file::get-last-write-timeReturns the date and time the specified file was last written to.
file::get-lengthGets the length of the file.
file::is-assemblyChecks if a given file is an assembly.
file::up-to-dateDetermines whether targetFile is more or equal up-to-date than srcFile.

Math Functions

NameSummary
math::absReturns the absolute value of the specified number
math::ceilingReturns the smallest whole number greater than or equal to the specified number
math::floorReturns the largest whole number less than or equal to the specified number.
math::roundRounds the value to the nearest whole number

NAnt Functions

NameSummary
framework::existsChecks whether the specified framework exists, and is valid.
framework::get-assembly-directoryGets the assembly directory of the specified framework.
framework::get-clr-versionGets the Common Language Runtime version of the current target framework.
framework::get-clr-versionGets the Common Language Runtime version of the specified framework.
framework::get-descriptionGets the description of the current target framework.
framework::get-descriptionGets the description of the specified framework.
framework::get-familyGets the family of the specified framework.
framework::get-framework-directoryGets the framework directory of the specified framework.
framework::get-frameworksGets a comma-separated list of frameworks filtered by the specified FrameworkTypes.
framework::get-runtime-engineGets the runtime engine of the specified framework.
framework::get-runtime-frameworkGets the identifier of the runtime framework.
framework::get-sdk-directoryGets the SDK directory of the specified framework.
framework::get-target-frameworkGets the identifier of the current target framework.
framework::get-tool-pathGets the absolute path of the specified tool for the current target framework.
framework::get-versionGets the version of the current target framework.
framework::get-versionGets the version of the specified framework.
framework::sdk-existsChecks whether the SDK for the specified framework is installed.
nant::get-assemblyGets the NAnt assembly.
nant::get-base-directoryGets the base directory of the appdomain in which NAnt is running.
platform::get-nameGets the name of the platform on which NAnt is running.
platform::is-unixChecks whether NAnt is running on Unix.
platform::is-win32 Checks whether NAnt is running on Windows (and not just 32-bit Windows as the name may lead you to believe).
platform::is-windowsChecks whether NAnt is running on Windows.
project::get-base-directoryGets the base directory of the current project.
project::get-buildfile-pathGets the local path to the build file.
project::get-buildfile-uriGets the Uri form of the build file.
project::get-default-targetGets the name of the target that will be executed when no other build targets are specified.
project::get-nameGets the name of the current project.
property::existsChecks whether the specified property exists.
property::get-valueGets the value of the specified property.
property::is-dynamicChecks whether the specified property is a dynamic property.
property::is-readonlyChecks whether the specified property is read-only.
target::existsChecks whether the specified target exists.
target::get-current-targetGets the name of the target being executed.
target::has-executedChecks whether the specified target has already been executed.
task::existsChecks whether the specified task exists.
task::get-assemblyReturns the Assembly from which the specified task was loaded.

Operating System Functions

NameSummary
operating-system::get-platformGets a PlatformID value that identifies the operating system platform.
operating-system::get-versionGets a Version object that identifies this operating system.
operating-system::to-stringConverts the value of the specified operating system to its equivalent String representation.

Path Functions

NameSummary
path::change-extensionChanges the extension of the path string.
path::combineCombines two paths.
path::get-directory-nameReturns the directory information for the specified path string.
path::get-extensionReturns the extension for the specified path string.
path::get-file-nameReturns the filename for the specified path string.
path::get-file-name-without-extensionReturns the filename without extension for the specified path string.
path::get-full-pathReturns the fully qualified path.
path::get-path-rootGets the root directory of the specified path.
path::get-temp-file-nameReturns a uniquely named zero-byte temporary file on disk and returns the full path to that file.
path::get-temp-pathGets the path to the temporary directory.
path::has-extensionDetermines whether a path string includes an extension.
path::is-path-rootedDetermines whether a path string is absolute.

String Functions

NameSummary
string::containsTests whether the specified string contains the given search string.
string::ends-withTests whether the specified string ends with the specified suffix string.
string::get-lengthReturns the length of the specified string.
string::index-ofReturns the position of the first occurrence in the specified string of the given search string.
string::last-index-ofReturns the position of the last occurrence in the specified string of the given search string.
string::pad-leftReturns the given string left-padded to the given length.
string::pad-rightReturns the given string right-padded to the given length.
string::replaceReturns a string corresponding to the replacement of a given string with another in the specified string.
string::starts-withTests whether the specified string starts with the specified prefix string.
string::substringReturns a substring of the specified string.
string::to-lowerReturns the specified string converted to lowercase.
string::to-upperReturns the specified string converted to uppercase.
string::trimReturns the given string trimmed of whitespace.
string::trim-endReturns the given string trimmed of trailing whitespace.
string::trim-startReturns the given string trimmed of leading whitespace.

Unix/Cygwin Functions

NameSummary
cygpath::get-dos-pathGets the DOS (short) form of the specified path.
cygpath::get-unix-pathGets the Unix form of the specified path.
cygpath::get-windows-pathGets the Windows form of the specified path.
pkg-config::existsDetermines whether the given package exists.
pkg-config::get-compile-flagsGets the compile flags required to compile the package, including all its dependencies.
pkg-config::get-link-flagsGets the link flags required to compile the package, including all its dependencies.
pkg-config::get-mod-versionDetermines the version of the given package.
pkg-config::get-variableGets the value of a variable for the specified package.
pkg-config::is-atleast-versionDetermines whether the given package is at least version version.
pkg-config::is-between-versionDetermines whether the given package is between two versions.
pkg-config::is-exact-versionDetermines whether the given package is exactly version version.
pkg-config::is-max-versionDetermines whether the given package is at no newer than version version.

Version Functions

NameSummary
fileversioninfo::get-company-nameGets the name of the company that produced the file.
fileversioninfo::get-file-versionGets the file version of a file.
fileversioninfo::get-product-nameGets the name of the product the file is distributed with.
fileversioninfo::get-product-versionGets the product version of a file.
fileversioninfo::get-version-infoReturns a FileVersionInfo representing the version information associated with the specified file.
version::get-buildGets the value of the build component of a given version.
version::get-majorGets the value of the major component of a given version.
version::get-minorGets the value of the minor component of a given version.
version::get-revisionGets the value of the revision component of a given version.


Filter Reference

FilterSummary
expandpropertiesParses NAnt properties and expressions
replacestringReplaces all occurrences of a given string in the original input with user-supplied replacement string.
replacetokensReplaces tokens in the original input with user-supplied values.
tabstospacesConverts tabs to spaces.


以上内容引用自Nant官网:http://nant.sourceforge.net/


已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页