Fields Summary |
---|
protected static final String | exe_nameName of the executable. The .exe suffix is deliberately not included in
anticipation of the unix version |
protected static final String | file_extwhat is the file extension we search on? |
protected static final String | file_patternand now derive the search pattern from the extension |
protected static final String | exe_titletitle of task for external presentation |
protected String | targetTypetype 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 |
protected boolean | verboseverbose flag |
protected boolean | listinglisting flag |
protected File | resourceFileresource file (.res format) to include in the app. |
protected boolean | failOnErrorflag to control action on execution trouble |
protected boolean | debugdebug flag. Controls generation of debug information. |
private File | keyfilefile containing private key |
protected String | extraOptionsany extra command options? |
protected Vector | referenceFilesetsfilesets of references |
private boolean | isMono |
Methods Summary |
---|
public void | Clear()reset all contents.
targetType = null;
srcDir = null;
listing = false;
verbose = false;
debug = true;
outputFile = null;
failOnError = true;
resourceFile = null;
extraOptions = null;
|
public void | addReference(org.apache.tools.ant.types.FileSet reference)add a new reference fileset to the compilation
referenceFilesets.add(reference);
|
private NetCommand | buildIlasmCommand()build up our ilasm command
NetCommand command = new NetCommand(this, exe_title, exe_name);
command.setFailOnError(getFailOnError());
//fill in args
command.addArgument(getDebugParameter());
command.addArgument(getTargetTypeParameter());
command.addArgument(getListingParameter());
command.addArgument(getOutputFileParameter());
command.addArgument(getResourceFileParameter());
command.addArgument(getVerboseParameter());
command.addArgument(getKeyfileParameter());
command.addArgument(getExtraOptionsParameter());
/*
* space for more argumentativeness
* command.addArgument();
* command.addArgument();
*/
return command;
|
public void | execute()This is the execution entry point. Build a list of files and call ilasm
on each of them.
log("This task is deprecated and will be removed in a future version\n"
+ "of Ant. It is now part of the .NET Antlib:\n"
+ "http://ant.apache.org/antlibs/dotnet/index.html",
Project.MSG_WARN);
NetCommand command = buildIlasmCommand();
addFilesAndExecute(command, false);
|
public boolean | getDebug()query the debug flag
return debug;
|
protected java.lang.String | getDebugParameter()get the argument or null for no argument needed
return debug ? "/debug" : null;
|
public java.lang.String | getExtraOptions()Gets the ExtraOptions attribute
return this.extraOptions;
|
protected java.lang.String | getExtraOptionsParameter()get any extra options or null for no argument needed
if (extraOptions != null && extraOptions.length() != 0) {
return extraOptions;
} else {
return null;
}
|
public boolean | getFailOnError()query fail on error flag
return failOnError;
|
protected java.lang.String | getKeyfileParameter()get the argument or null for no argument needed
if (keyfile != null) {
return "/keyfile:" + keyfile.toString();
} else {
return null;
}
|
protected java.lang.String | getListingParameter()turn the listing flag into a parameter for ILASM
if (!isMono) {
return listing ? "/listing" : "/nolisting";
}
return null;
|
protected java.lang.String | getOutputFileParameter()get the output file
if (outputFile == null) {
return null;
}
return "/output=" + outputFile.toString();
|
protected java.lang.String | getResourceFileParameter()Gets the resourceFileParameter attribute of the Ilasm task
if (resourceFile != null) {
return "/resource=" + resourceFile.toString();
} else {
return null;
}
|
public java.lang.String | getTargetType()accessor method for target type
return targetType;
|
protected java.lang.String | getTargetTypeParameter()g get the target type or null for no argument needed
if (!notEmpty(targetType)) {
return null;
}
if (targetType.equals("exe")) {
return "/exe";
} else if (targetType.equals("library")) {
return "/dll";
} else {
return null;
}
|
protected java.lang.String | getVerboseParameter()turn the verbose flag into a parameter for ILASM
return verbose ? null : "/quiet";
|
protected static boolean | isFileManagedBinary(java.io.File file)test for a file being managed or not
String filename = file.toString().toLowerCase();
return filename.endsWith(".exe") || filename.endsWith(".dll")
|| filename.endsWith(".netmodule");
|
protected boolean | notEmpty(java.lang.String s)test for a string containing something useful
return s != null && s.length() != 0;
|
public void | setDebug(boolean f)set the debug flag on or off.
debug = f;
|
public void | setExtraOptions(java.lang.String extraOptions)Any extra options which are not explicitly
supported by this task.
this.extraOptions = extraOptions;
|
public void | setFailOnError(boolean b)If true, fails if ilasm tool fails.
failOnError = b;
|
public void | setKeyfile(java.io.File keyfile)the name of a file containing a private key.
this.keyfile = keyfile;
|
public void | setListing(boolean b)If true, produce a listing (off by default).
listing = b;
|
public void | setMono(boolean b)Explicitly override the Mono auto-detection.
Defaults to false on Windows and true on any other platform.
isMono = b;
|
public void | setOutputFile(java.io.File params)Set the output file; identical to setDestFile
outputFile = params;
|
public void | setOwner(java.lang.String s)Sets the Owner attribute.
log("This option is not supported by ILASM as of Beta-2, "
+ "and will be ignored", Project.MSG_WARN);
|
public void | setResourceFile(java.io.File fileName)name of resource file to include.
resourceFile = fileName;
|
public void | setTargetType(org.apache.tools.ant.taskdefs.optional.dotnet.Ilasm$TargetTypes targetType)set the target type to one of exe|library
this.targetType = targetType.getValue();
|
public void | setTargetType(java.lang.String targetType)Sets the type of target, either "exe" or "library".
this.targetType = targetType.toLowerCase();
if (!targetType.equals("exe") && !targetType.equals("library")) {
throw new BuildException("targetType " + targetType + " is not a valid type");
}
|
public void | setVerbose(boolean b)If true, enable verbose ILASM output.
verbose = b;
|