All parameters are optional: <csc/> should suffice to produce a debug build of all *.cs files. References to external files do require explicit enumeration, so are one of the first attributes to consider adding.
The task is a directory based task, so attributes like includes="**/*.cs" and excludes="broken.cs" can be used to control the files pulled in. By default, all *.cs files from the project folder down are included in the command. When this happens the destFile -if not specified- is taken as the first file in the list, which may be somewhat hard to control. Specifying the output file with 'destfile' seems prudent.
Also, dependency checking only works if destfile is set.
Attribute | Description | Example Values |
additionalModules | Semicolon separated list of modules to refer to | |
defaultexcludes | indicates whether default excludes should be used or not | "true"(default) or "false" |
definitions | defined constants | "RELEASE;BETA1" |
debug | include debug information | "true"(default) |
destFile | name of exe/library to create | "example.exe" |
docFile | name of file for documentation | "doc.xml" |
excludes | comma- or space-separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. | |
excludesfile | the name of a file. Each line of this file is taken to be an exclude pattern | |
extraOptions | Any extra options which aren't explicitly supported by the CSharp task | "/warnaserror+ /baseaddress:0x12840000" |
failOnError | Should a failed compile halt the build? | "true"(default) or "false" |
fileAlign | set the file alignment. Valid values are 0,512, 1024, 2048, 4096, 8192, and 16384 0 means 'leave to the compiler' | 512 |
fullpaths | print the full path of files on on errors | |
includes | comma- or space-separated list of patterns of files that must be included. All files are included when omitted. | |
includeDefaultReferences | Flag which when true automatically includes the common assemblies in dotnet, and tells the compiler to link in mscore.dll | "true"(default) or "false" |
includesfile | the name of a file. Each line of this file is taken to be an include pattern | |
incremental | Incremental build flag. Avoid till it works | "true" or "false"(default) |
mainClass | name of main class for executables | "com.example.project.entrypoint" |
noConfig | a flag which tells the compiler not to read in the compiler settings files 'csc.rsp' in its bin directory and then the local directory | "true" or "false"(default) |
optimize | optimisation flag | "true" or "false"(default) |
references | Semicolon separated list of dlls to refer to | "mylib.dll;nunit.dll" |
referenceFiles | Ant Path descriptioon of references to include. Wildcards should work. | |
srcDir | source directory (default = project directory) | "." |
targetType | Type of target | "exe", "module", "winexe" or "library" |
unsafe | enable the unsafe keyword | "true" or "false"(default) |
utf8output | require all compiler output to be in utf-8 format | "true" or "false"(default) |
warnLevel | level of warning currently between 1 and 4 with 4 being the strictest. | "1"-"4" |
win32Icon | filename of icon to include | "res/myicon.ico" |
win32res | filename of a win32 resource (.RES)file to include This is not a .NET resource, but it what windows is used to. | "res/myapp.res" |
Example
<csc optimize="true" debug="false" docFile="documentation.xml" warnLevel="4" unsafe="false" targetType="exe" incremental="false" definitions="RELEASE" excludes="src/unicode_class.cs" mainClass = "MainApp" destFile="NetApp.exe" />
Task to assemble .net 'Intermediate Language' files. The task will only work on windows until other platforms support csc.exe or an equivalent. ilasm.exe must be on the execute path too.
All parameters are optional: <il/> should suffice to produce a debug build of all *.il files. The option set is roughly compatible with the CSharp class; even though the command line options are only vaguely equivalent. [The low level commands take things like /OUT=file, csc wants /out:file ... /verbose is used some places; /quiet here in ildasm... etc.] It would be nice if someone made all the command line tools consistent (and not as brittle as the java cmdline tools)
The task is a directory based task, so attributes like includes="*.il" and excludes="broken.il" can be used to control the files pulled in. Each file is built on its own, producing an appropriately named output file unless manually specified with outfile
Attribute | Description | Example |
defaultexcludes | indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted. | |
debug | include debug information | true (default) |
excludes | comma separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted. | |
excludesfile | the name of a file. Each line of this file is taken to be an exclude pattern | |
extraOptions | Any extra options which aren't explicitly supported by the ilasm task, primarily because they arent really documented: use ilasm /? to see them | |
failOnError | Should a failed compile halt the build? | "true"(default) |
fullpaths | Should error text provide the full path to files | "true"(default) |
includes | comma separated list of patterns of files that must be included. All files are included when omitted. | |
includesfile | the name of a file. Each line of this file is taken to be an include pattern | |
keyfile | the name of a file containing a private key, with which the assembly output is checksumed and then MD5 signed to have a strong name | |
listing | Produce a listing (off by default). Listings go to the current output stream | "on", "off" (default) |
outputFile | filename of output | "example.exe" |
resourceFile | name of resource file to include | "resources.res" |
srcDir | source directory (default = project directory) | |
targetType | Type of target. library means DLL is output. | "exe"(default), "library" |
verbose | output progress messages | "on", "off" (default) |
Example
<ilasm outputFile="app.exe" verbose="on" listing="on" owner="secret" />
This task is dependency aware when using a file as a source and destination;
so if you <get> the file (with usetimestamp="true"
) then
you only rebuild stuff when the WSDL file is changed. Of course,
if the server generates a new timestamp every time you ask for the WSDL,
this is not enough...use the <filesmatch> <condition> to
to byte for byte comparison against a cached WSDL file then make
the target conditional on that test failing.
Attribute | Description | Example |
destFile | name of file to generate. Required | ApacheNet.cs |
srcFile | name of WSDL file to use. Required if url is not set | service.wsdl |
url | url to retrive WSDL from. required if srcFile is unset | http://localhost/service?wsdl |
server | generate server stubs, not client proxy code. optional; default false | "false"(default) |
namespace | namespace to place the source in. optional; default "" | Apache.Net |
language | language; one of "CS", "JS", or "VB" optional; | "CS" (default) |
failOnError | Should failure halt the build? | "true"(default) |
extraOptions | Any extra options which aren't explicitly supported by the task, like all the proxy server config stuff |
External changes
Copyright © 2000-2002 Apache Software Foundation. All rights Reserved.