|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.ProjectComponent org.apache.tools.ant.Task org.apache.tools.ant.taskdefs.Java org.codehaus.groovy.ant.Groovy
public class Groovy extends Java
Executes a series of Groovy statements.
Statements can either be read in from a text file using the src attribute or from between the enclosing groovy tags.
Method Summary | |
---|---|
protected void
|
addClassPathes(GroovyClassLoader classLoader)
Adds the class paths (if any) |
void
|
addFileset(FileSet set)
Adds a set of files (nested fileset attribute). |
void
|
addText(String txt)
Set an inline command to execute. |
Commandline.Argument
|
createArg()
|
Path
|
createClasspath()
Returns a new path element that can be configured. |
protected void
|
execGroovy(String txt, PrintStream out)
Exec the statement. |
void
|
execute()
Load the file and then execute it |
Path
|
getClasspath()
Gets the classpath. |
static void
|
main(String[] args)
|
protected void
|
printResults(PrintStream out)
|
protected void
|
runStatements(Reader reader, PrintStream out)
|
void
|
setAppend(boolean append)
Whether output should be appended to or overwrite an existing file. |
void
|
setClasspath(Path classpath)
Sets the classpath for loading. |
void
|
setClasspathRef(Reference ref)
Set the classpath for loading using the classpath reference. |
void
|
setConfigscript(String configscript)
Sets the configuration script for the groovy compiler configuration. |
void
|
setContextClassLoader(boolean contextClassLoader)
|
void
|
setFork(boolean fork)
Should the script be executed using a forked process. |
void
|
setIncludeAntRuntime(boolean includeAntRuntime)
Should the system classpath be included on the classpath when forking. |
void
|
setIndy(boolean indy)
Sets the indy flag to enable or disable invokedynamic |
void
|
setOutput(File output)
Set the output file; optional, defaults to the Ant log. |
void
|
setScriptBaseClass(String scriptBaseClass)
Set the script base class name |
void
|
setSrc(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. |
void
|
setUseGroovyShell(boolean useGroovyShell)
Should a new GroovyShell be used when forking. |
Methods inherited from class Task | |
---|---|
maybeConfigure, getOwningTarget, getTaskName, getTaskType, setTaskType, setTaskName, setOwningTarget, getRuntimeConfigurableWrapper, setRuntimeConfigurableWrapper, reconfigure, perform, bindToOwner, log, log, log, log, init, execute, getProject, setLocation, setProject, clone, getLocation, getDescription, setDescription, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
protected void addClassPathes(GroovyClassLoader classLoader)
classLoader
- the classloader to configure
public void addFileset(FileSet set)
set
- the fileset representing source files
public void addText(String txt)
txt
- the inline groovy ommands to execute
public Commandline.Argument createArg()
public Path createClasspath()
protected void execGroovy(String txt, PrintStream out)
txt
- the groovy source to execout
- not used?
public void execute()
public Path getClasspath()
public static void main(String[] args)
protected void printResults(PrintStream out)
protected void runStatements(Reader reader, PrintStream out)
public void setAppend(boolean append)
append
- set to true to append
public void setClasspath(Path classpath)
classpath
- The classpath to set
public void setClasspathRef(Reference ref)
ref
- the refid to use
public void setConfigscript(String configscript)
configscript
- path to the configuration script
public void setContextClassLoader(boolean contextClassLoader)
public void setFork(boolean fork)
fork
- true if the script should be executed in a forked process
public void setIncludeAntRuntime(boolean includeAntRuntime)
includeAntRuntime
- true if the system classpath should be on the classpath
public void setIndy(boolean indy)
indy
- true means invokedynamic support is active
public void setOutput(File output)
output
- the output file
public void setScriptBaseClass(String scriptBaseClass)
scriptBaseClass
- the name of the base class for scripts
public void setSrc(File srcFile)
srcFile
- the file containing the groovy script to execute
public void setStacktrace(boolean stacktrace)
stacktrace
- set to true to enable stacktrace reporting
public void setUseGroovyShell(boolean useGroovyShell)
useGroovyShell
- true if GroovyShell should be used to run the script directly
Copyright © 2003-2013 The Codehaus. All rights reserved.