terp - the ANT Tasks
v1.3.337

com.codemesh.terp.ant
Class TerpExec

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by com.codemesh.terp.ant.TerpAwareTask
              extended by com.codemesh.terp.ant.TerpExec
All Implemented Interfaces:
TerpAware, TerpContextHolder, java.lang.Cloneable

public class TerpExec
extends TerpAwareTask

A terp executor that does not inherit from the ANT <exec> task.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.codemesh.terp.ant.TerpAware
TerpAware.Delegate
 
Field Summary
protected  java.lang.String expression
           
protected  boolean failOnError
           
protected  java.lang.String result
           
protected  boolean showErr
           
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
TerpExec()
           
TerpExec(org.apache.tools.ant.Project p)
           
 
Method Summary
 void execute()
           
 java.lang.String getExpression()
           
 java.lang.String getResult()
           
 boolean getShowErr()
           
 boolean isFailOnError()
           
 void setExpression(java.lang.String expression)
           
 void setFailOnError(boolean failOnError)
          Specify whether to fail the task if the process invocation returns anything but 0 or throws an exception.
 void setResult(java.lang.String result)
          Specify the name of a variable storing an instance of type ProcesExecutor.Result for the executed process.
 void setShowErr(boolean showErr)
          Specifies whether the invoked process' stderr output should be logged or not.
 
Methods inherited from class com.codemesh.terp.ant.TerpAwareTask
getContext, getIf, getUnless, satisfiesConditions, setContext, setIf, setProject, setUnless
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expression

protected java.lang.String expression

result

protected java.lang.String result

failOnError

protected boolean failOnError

showErr

protected boolean showErr
Constructor Detail

TerpExec

public TerpExec()

TerpExec

public TerpExec(org.apache.tools.ant.Project p)
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException

getExpression

public java.lang.String getExpression()

setExpression

public void setExpression(java.lang.String expression)

getResult

public java.lang.String getResult()

setResult

public void setResult(java.lang.String result)
Specify the name of a variable storing an instance of type ProcesExecutor.Result for the executed process. This instance provides access to stdout, stderr, and exitcode of the executed process.

Parameters:
result - a variable name that can be used in subsequent tasks.

isFailOnError

public boolean isFailOnError()

setFailOnError

public void setFailOnError(boolean failOnError)
Specify whether to fail the task if the process invocation returns anything but 0 or throws an exception.

Parameters:
failOnError - true to fail on error, false to continue.

getShowErr

public boolean getShowErr()

setShowErr

public void setShowErr(boolean showErr)
Specifies whether the invoked process' stderr output should be logged or not. Irrespective of the state of this flag, the task can store all outputs from the process invocation in a result variable of type ProcessExecutor.Result whose name is provided via the setResult(String) method.

Parameters:
showErr - true to log the error output, false to swallow it.

terp - the ANT Tasks
v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.