public class NetCommand
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected org.apache.tools.ant.types.Commandline |
commandLine
what is the command line
|
protected org.apache.tools.ant.taskdefs.Execute |
executable
executable
|
protected boolean |
failOnError
flag to control action on execution trouble
|
protected org.apache.tools.ant.Task |
owner
owner project
|
protected java.lang.String |
program
actual program to invoke
|
protected java.lang.String |
title
title of the command
|
protected boolean |
traceCommandLine
trace flag
|
Constructor and Description |
---|
NetCommand(org.apache.tools.ant.Task owner,
java.lang.String title,
java.lang.String program)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addArgument(java.lang.String argument)
add an argument to a command line; do nothing if the arg is null or
empty string
|
void |
addArgument(java.lang.String argument,
boolean mayBeInResponseFile)
add an argument to a command line; do nothing if the arg is
null or empty string
|
void |
addArgument(java.lang.String argument1,
java.lang.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(java.lang.String[] arguments)
Add multiple arguments to a command line; do nothing for args
that are is null or empty strings
|
int |
getAutomaticResponseFileThreshold()
getter for threshold
|
boolean |
getFailFailOnError()
query fail on error flag
|
boolean |
isUseResponseFile()
getter
|
protected void |
logError(java.lang.String msg)
error text log
|
protected void |
logVerbose(java.lang.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(org.apache.tools.ant.DirectoryScanner scanner,
java.util.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(java.io.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
|
protected org.apache.tools.ant.Task owner
protected org.apache.tools.ant.taskdefs.Execute executable
protected org.apache.tools.ant.types.Commandline commandLine
protected java.lang.String title
protected java.lang.String program
protected boolean traceCommandLine
protected boolean failOnError
public NetCommand(org.apache.tools.ant.Task owner, java.lang.String title, java.lang.String program)
title
- (for logging/errors)owner
- owner taskprogram
- app we are to runpublic void setTraceCommandLine(boolean b)
b
- trace flagpublic void setFailOnError(boolean b)
b
- fail flag -set to true to cause an exception to be raised if
the return value != 0public boolean getFailFailOnError()
public void setDirectory(java.io.File directory)
directory
- protected void logVerbose(java.lang.String msg)
msg
- string to add to log if verbose is defined for the buildprotected void logError(java.lang.String msg)
msg
- message to display as an errorpublic void addArgument(java.lang.String argument)
The given argument may be added to a response file.
argument
- The feature to be added to the Argument attributepublic void addArgument(java.lang.String argument, boolean mayBeInResponseFile)
argument
- The feature to be added to the Argument attributemayBeInResponseFile
- whether the argument is allowed
inside a response file.public void addArguments(java.lang.String[] arguments)
The given arguments may be added to a response file.
arguments
- The features to be added to the Argument attributepublic void addArgument(java.lang.String argument1, java.lang.String argument2)
The resulting argument may be added to a response file.
argument1
- The first argumentargument2
- The second argumentpublic boolean isUseResponseFile()
public void setUseResponseFile(boolean useResponseFile)
useResponseFile
- public int getAutomaticResponseFileThreshold()
public void setAutomaticResponseFileThreshold(int automaticResponseFileThreshold)
automaticResponseFileThreshold
- protected void prepareExecutor()
public void runCommand() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
- if something goes wrong and the
failOnError flag is truepublic int scanOneFileset(org.apache.tools.ant.DirectoryScanner scanner, java.util.Hashtable filesToBuild, long outputTimestamp)
scanner
- filesToBuild
- outputTimestamp
- timestamp to compare against