|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.Java
org.codehaus.groovy.ant.Groovy
public class Groovy
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.
| Field Summary |
|---|
| Fields inherited from class org.apache.tools.ant.taskdefs.Java |
|---|
redirector, redirectorElement |
| 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 | |
|---|---|
Groovy()
|
|
| Method Summary | |
|---|---|
protected void |
addClassPathes(GroovyClassLoader classLoader)
Adds the class paths (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. |
static void |
main(java.lang.String[] args)
|
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 |
setContextClassLoader(boolean contextClassLoader)
Setting to true will cause the contextClassLoader to be set with the classLoader of the shell used to run the script. |
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 |
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. |
void |
setUseGroovyShell(boolean useGroovyShell)
Should a new GroovyShell be used when forking. |
| Methods inherited from class org.apache.tools.ant.taskdefs.Java |
|---|
addAssertions, addConfiguredRedirector, addEnv, addSysproperty, addSyspropertyset, checkConfiguration, clearArgs, createBootclasspath, createJvmarg, createPermissions, createWatchdog, executeJava, executeJava, getCommandLine, getSysProperties, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, maybeSetResultPropertyValue, run, setArgs, setClassname, setCloneVm, setDir, setError, setErrorProperty, setFailonerror, setInput, setInputString, setJar, setJvm, setJvmargs, setJVMVersion, setLogError, setMaxmemory, setNewenvironment, setOutputproperty, setResultProperty, setSpawn, setTimeout, setupRedirector |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, 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, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Groovy()
| Method Detail |
|---|
public void setFork(boolean fork)
setFork in class org.apache.tools.ant.taskdefs.Javafork - true if the script should be executed in a forked processpublic void setUseGroovyShell(boolean useGroovyShell)
useGroovyShell - true if GroovyShell should be used to run the script directlypublic void setIncludeAntRuntime(boolean includeAntRuntime)
includeAntRuntime - true if the system classpath should be on the classpathpublic void setStacktrace(boolean stacktrace)
stacktrace - set to true to enable stacktrace reportingpublic void setSrc(java.io.File srcFile)
srcFile - the file containing the groovy script to executepublic void addText(java.lang.String txt)
txt - the inline groovy ommands to executepublic void addFileset(org.apache.tools.ant.types.FileSet set)
set - the fileset representing source filespublic void setOutput(java.io.File output)
setOutput in class org.apache.tools.ant.taskdefs.Javaoutput - the output filepublic void setAppend(boolean append)
setAppend in class org.apache.tools.ant.taskdefs.Javaappend - set to true to appendpublic void setClasspath(org.apache.tools.ant.types.Path classpath)
setClasspath in class org.apache.tools.ant.taskdefs.Javaclasspath - The classpath to setpublic org.apache.tools.ant.types.Path createClasspath()
createClasspath in class org.apache.tools.ant.taskdefs.Javapublic void setClasspathRef(org.apache.tools.ant.types.Reference ref)
setClasspathRef in class org.apache.tools.ant.taskdefs.Javaref - 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.taskdefs.Javaorg.apache.tools.ant.BuildExceptionpublic org.apache.tools.ant.types.Commandline.Argument createArg()
createArg in class org.apache.tools.ant.taskdefs.Java
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 execout - the outputstream to use
java.io.IOException - if something goes wrong
protected void execGroovy(java.lang.String txt,
java.io.PrintStream out)
txt - the groovy source to execout - not used?public static void main(java.lang.String[] args)
protected void addClassPathes(GroovyClassLoader classLoader)
classLoader - the classloader to configureprotected void printResults(java.io.PrintStream out)
out - the output PrintStream to print topublic void setContextClassLoader(boolean contextClassLoader)
contextClassLoader - set to true to set the context classloader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||