public class Groovy
extends org.apache.tools.ant.Task
Statements can either be read in from a text file using the src attribute or from between the enclosing groovy tags.
Constructor and Description |
---|
Groovy() |
Modifier and Type | Method and Description |
---|---|
protected void |
addClassPathes(GroovyClassLoader classLoader)
Adds the class pathes (if any)
|
void |
addFileset(org.apache.tools.ant.types.FileSet set)
Adds a set of files (nested fileset attribute).
|
void |
addText(java.lang.String txt)
Set an inline command to execute.
|
org.apache.tools.ant.types.Commandline.Argument |
createArg() |
org.apache.tools.ant.types.Path |
createClasspath()
Returns a new path element that can be configured.
|
protected void |
execGroovy(java.lang.String txt,
java.io.PrintStream out)
Exec the statement.
|
void |
execute()
Load the file and then execute it
|
org.apache.tools.ant.types.Path |
getClasspath()
Gets the classpath.
|
protected void |
printResults(java.io.PrintStream out)
print any results in the statement.
|
protected void |
runStatements(java.io.Reader reader,
java.io.PrintStream out)
Read in lines and execute them.
|
void |
setAppend(boolean append)
Whether output should be appended to or overwrite
an existing file.
|
void |
setClasspath(org.apache.tools.ant.types.Path classpath)
Sets the classpath for loading.
|
void |
setClasspathRef(org.apache.tools.ant.types.Reference ref)
Set the classpath for loading
using the classpath reference.
|
void |
setOutput(java.io.File output)
Set the output file;
optional, defaults to the Ant log.
|
void |
setSrc(java.io.File srcFile)
Set the name of the file to be run.
|
void |
setStacktrace(boolean stacktrace)
Enable compiler to report stack trace information if a problem occurs
during compilation.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
public void setStacktrace(boolean stacktrace)
stacktrace
- set to true to enable stacktrace reportingpublic void setSrc(java.io.File srcFile)
public void addText(java.lang.String txt)
public void addFileset(org.apache.tools.ant.types.FileSet set)
public void setOutput(java.io.File output)
public void setAppend(boolean append)
append
- set to true to appendpublic void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- The classpath to setpublic org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference ref)
ref
- the refid to usepublic org.apache.tools.ant.types.Path getClasspath()
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
public org.apache.tools.ant.types.Commandline.Argument createArg()
protected void runStatements(java.io.Reader reader, java.io.PrintStream out) throws java.io.IOException
reader
- the reader from which to get the groovy source to execjava.io.IOException
protected void execGroovy(java.lang.String txt, java.io.PrintStream out)
txt
- the groovy source to execprotected void addClassPathes(GroovyClassLoader classLoader)
classLoader
- the classloader to configureprotected void printResults(java.io.PrintStream out)
out
- the output PrintStream to print to