|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tools.ant.taskdefs.optional.dotnet.NetCommand
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.
Field Summary | |
protected Commandline |
_commandLine
what is the command line |
protected Execute |
_exe
executabe |
protected boolean |
_failOnError
flag to control action on execution trouble |
protected 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 Summary | |
NetCommand(Task owner,
java.lang.String title,
java.lang.String program)
constructor |
Method Summary | |
void |
addArgument(java.lang.String argument)
add an argument to a command line; do nothing if the arg is null or empty string |
boolean |
getFailFailOnError()
query fail on error flag |
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. |
void |
setFailOnError(boolean b)
set fail on error flag |
void |
setTraceCommandLine(boolean b)
turn tracing on or off |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Task _owner
protected Execute _exe
protected Commandline _commandLine
protected java.lang.String _title
protected java.lang.String _program
protected boolean _traceCommandLine
protected boolean _failOnError
Constructor Detail |
public NetCommand(Task owner, java.lang.String title, java.lang.String program)
owning
- tasktitle
- (for logging/errors)executable.
- Leave off the '.exe. for future portabilityMethod Detail |
public 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()
protected void logVerbose(java.lang.String msg)
msg
- string to add to log iff 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)
argument
- The feature to be added to the Argument attributeprotected void prepareExecutor()
public void runCommand() throws BuildException
an
- exception of something goes wrong and the failOnError flag is true
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |