org.apache.tools.ant.taskdefs.optional.dotnet
Class NetCommand
java.lang.Object
org.apache.tools.ant.taskdefs.optional.dotnet.NetCommand
public class NetCommand
extends java.lang.Object
This is a helper class to spawn net commands out. In its initial form it
contains no .net specifics, just contains all the command line/exe
construction stuff. However, it may be handy in future to have a means of
setting the path to point to the dotnet bin directory; in which case the
shared code should go in here.
void | addArgument(String argument) - add an argument to a command line; do nothing if the arg is null or
empty string
|
void | addArgument(String argument1, String argument2) - concatenate two strings together and add them as a single argument,
but only if argument2 is non-null and non-zero length
|
void | addArguments(String[] arguments) - add an argument to a command line; do nothing if the arg is null or
empty string
|
int | getAutomaticResponseFileThreshold() - getter for threshold
|
boolean | getFailFailOnError() - query fail on error flag
|
boolean | isUseResponseFile() - getter
|
protected void | logError(String msg) - error text log
|
protected void | logVerbose(String msg) - verbose text log
|
protected void | prepareExecutor() - set up the command sequence..
|
void | runCommand() - Run the command using the given Execute instance.
|
int | scanOneFileset(DirectoryScanner scanner, Hashtable filesToBuild, long outputTimestamp) - scan through one fileset for files to include
|
void | setAutomaticResponseFileThreshold(int automaticResponseFileThreshold) - set threshold for automatically using response files -use 0 for off
|
void | setDirectory(File directory) - set the directory to run from, if the default is inadequate
|
void | setFailOnError(boolean b) - set fail on error flag
|
void | setTraceCommandLine(boolean b) - turn tracing on or off
|
void | setUseResponseFile(boolean useResponseFile) - set this to true to always use the response file
|
commandLine
protected Commandline commandLine
what is the command line
executable
protected Execute executable
executable
failOnError
protected boolean failOnError
flag to control action on execution trouble
owner
protected Task owner
owner project
program
protected String program
actual program to invoke
title
protected String title
title of the command
traceCommandLine
protected boolean traceCommandLine
trace flag
NetCommand
public NetCommand(Task owner,
String title,
String program)
constructor
owner
- owner tasktitle
- (for logging/errors)program
- app we are to run
addArgument
public void addArgument(String argument)
add an argument to a command line; do nothing if the arg is null or
empty string
argument
- The feature to be added to the Argument attribute
addArgument
public void addArgument(String argument1,
String argument2)
concatenate two strings together and add them as a single argument,
but only if argument2 is non-null and non-zero length
argument1
- The first argumentargument2
- The second argument
addArguments
public void addArguments(String[] arguments)
add an argument to a command line; do nothing if the arg is null or
empty string
getAutomaticResponseFileThreshold
public int getAutomaticResponseFileThreshold()
getter for threshold
- 0 for disabled, or a threshold for enabling response files
getFailFailOnError
public boolean getFailFailOnError()
query fail on error flag
- The failFailOnError value
isUseResponseFile
public boolean isUseResponseFile()
getter
logError
protected void logError(String msg)
error text log
msg
- message to display as an error
logVerbose
protected void logVerbose(String msg)
verbose text log
msg
- string to add to log if verbose is defined for the build
prepareExecutor
protected void prepareExecutor()
set up the command sequence..
runCommand
public void runCommand()
throws BuildException
Run the command using the given Execute instance.
BuildException
- if something goes wrong and the
failOnError flag is true
scanOneFileset
public int scanOneFileset(DirectoryScanner scanner,
Hashtable filesToBuild,
long outputTimestamp)
scan through one fileset for files to include
scanner
- filesToBuild
- outputTimestamp
- timestamp to compare against
setAutomaticResponseFileThreshold
public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold)
set threshold for automatically using response files -use 0 for off
automaticResponseFileThreshold
-
setDirectory
public void setDirectory(File directory)
set the directory to run from, if the default is inadequate
setFailOnError
public void setFailOnError(boolean b)
set fail on error flag
b
- fail flag -set to true to cause an exception to be raised if
the return value != 0
setTraceCommandLine
public void setTraceCommandLine(boolean b)
turn tracing on or off
setUseResponseFile
public void setUseResponseFile(boolean useResponseFile)
set this to true to always use the response file
Copyright B) 2000-2007 Apache Software Foundation. All Rights Reserved.