| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.ant.dotnet.NetCommand
public class 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  org.apache.tools.ant.types.Commandline | commandLinewhat is the command line | 
| protected  org.apache.tools.ant.taskdefs.Execute | executableexecutable | 
| protected  boolean | failOnErrorflag to control action on execution trouble | 
| protected  org.apache.tools.ant.Task | ownerowner project | 
| protected  java.lang.String | programactual program to invoke | 
| protected  java.lang.String | titletitle of the command | 
| protected  boolean | traceCommandLinetrace flag | 
| Constructor Summary | |
|---|---|
| NetCommand(org.apache.tools.ant.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 | 
|  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 | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
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
| Constructor Detail | 
|---|
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 run| Method 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()
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 attribute
public 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 attribute
public 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 true
public int scanOneFileset(org.apache.tools.ant.DirectoryScanner scanner,
                          java.util.Hashtable filesToBuild,
                          long outputTimestamp)
scanner - filesToBuild - outputTimestamp - timestamp to compare against
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||