Assembles .NET Intermediate Language files.
ilasm.exe must be on the execute path, unless another executable
or the full path to that executable is specified in the
executable
parameter
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. You can also use nested <src> filesets to refer to source.
debug
protected boolean debug
debug flag. Controls generation of debug information.
exe_name
protected static final String exe_name
Name of the executable. The .exe suffix is deliberately not included in
anticipation of the unix version
exe_title
protected static final String exe_title
title of task for external presentation
extraOptions
protected String extraOptions
any extra command options?
failOnError
protected boolean failOnError
flag to control action on execution trouble
file_ext
protected static final String file_ext
what is the file extension we search on?
file_pattern
protected static final String file_pattern
and now derive the search pattern from the extension
listing
protected boolean listing
listing flag
referenceFilesets
protected Vector referenceFilesets
filesets of references
resourceFile
protected File resourceFile
resource file (.res format) to include in the app.
targetType
protected String targetType
type of target. Should be one of exe|library|module|winexe|(null)
default is exe; the actual value (if not null) is fed to the command
line.
See /target
verbose
protected boolean verbose
verbose flag
Clear
public void Clear()
reset all contents.
addReference
public void addReference(FileSet reference)
add a new reference fileset to the compilation
reference
- the fileset to use.
execute
public void execute()
throws BuildException
This is the execution entry point. Build a list of files and call ilasm
on each of them.
- execute in interface Task
getDebug
public boolean getDebug()
query the debug flag
- true if debug is turned on
getDebugParameter
protected String getDebugParameter()
get the argument or null for no argument needed
getExtraOptions
public String getExtraOptions()
Gets the ExtraOptions attribute
getExtraOptionsParameter
protected String getExtraOptionsParameter()
get any extra options or null for no argument needed
- The ExtraOptions Parameter to CSC
getFailOnError
public boolean getFailOnError()
query fail on error flag
- The failFailOnError value
getKeyfileParameter
protected String getKeyfileParameter()
get the argument or null for no argument needed
- The keyfileParameter value
getListingParameter
protected String getListingParameter()
turn the listing flag into a parameter for ILASM
- the appropriate string from the state of the listing flag
getOutputFileParameter
protected String getOutputFileParameter()
get the output file
- the argument string or null for no argument
getResourceFileParameter
protected String getResourceFileParameter()
Gets the resourceFileParameter attribute of the Ilasm task
- The resourceFileParameter value
getTargetType
public String getTargetType()
accessor method for target type
- the current target option
getTargetTypeParameter
protected String getTargetTypeParameter()
g get the target type or null for no argument needed
- The TargetTypeParameter value
getVerboseParameter
protected String getVerboseParameter()
turn the verbose flag into a parameter for ILASM
- null or the appropriate command line string
isFileManagedBinary
protected static boolean isFileManagedBinary(File file)
test for a file being managed or not
- true if we think this is a managed executable, and thus OK
for linking
- look at the PE header of the exe and see if it is managed or not.
notEmpty
protected boolean notEmpty(String s)
test for a string containing something useful
- true if the argument is not null or empty
setDebug
public void setDebug(boolean f)
set the debug flag on or off.
setExtraOptions
public void setExtraOptions(String extraOptions)
Any extra options which are not explicitly
supported by this task.
extraOptions
- The new ExtraOptions value
setFailOnError
public void setFailOnError(boolean b)
If true, fails if ilasm tool fails.
b
- The new failOnError value
setKeyfile
public void setKeyfile(File keyfile)
the name of a file containing a private key.
keyfile
- The new keyfile value
setListing
public void setListing(boolean b)
If true, produce a listing (off by default).
b
- flag set to true for listing on
setMono
public void setMono(boolean b)
Explicitly override the Mono auto-detection.
Defaults to false on Windows and true on any other platform.
setOutputFile
public void setOutputFile(File params)
Set the output file; identical to setDestFile
params
- The new outputFile value
setOwner
public void setOwner(String s)
Sets the Owner attribute.
setResourceFile
public void setResourceFile(File fileName)
name of resource file to include.
fileName
- path to the file. Can be relative, absolute, whatever.
setTargetType
public void setTargetType(String targetType)
throws BuildException
Sets the type of target, either "exe" or "library".
targetType
- one of exe|library|
setTargetType
public void setTargetType(Ilasm.TargetTypes targetType)
set the target type to one of exe|library
targetType
- the enumerated value.
setVerbose
public void setVerbose(boolean b)
If true, enable verbose ILASM output.
b
- flag set to true for verbose on