|
Groovy Documentation | |||||||
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.MatchingTask org.codehaus.groovy.ant.Groovyc
public class Groovyc extends org.apache.tools.ant.taskdefs.MatchingTask
Compiles Groovy source files. This task can take the following arguments:
When this task executes, it will recursively scan srcdir and destdir looking for Groovy source files to compile. This task makes its compile decision based on timestamp.
Based heavily on the Javac implementation in Ant.
Field Summary | |
---|---|
protected java.io.File[] |
compileList
|
protected CompilerConfiguration |
configuration
|
protected boolean |
failOnError
|
protected boolean |
listFiles
|
Method Summary | |
---|---|
void
|
addConfiguredJavac(org.apache.tools.ant.taskdefs.Javac javac)
Add the configured nested javac task if present to initiate joint compilation. |
protected void
|
addToCompileList(java.io.File[] newFiles)
|
protected GroovyClassLoader
|
buildClassLoaderFor()
|
protected void
|
checkParameters()
|
protected void
|
compile()
|
org.apache.tools.ant.types.Path
|
createClasspath()
Adds a path to the classpath. |
org.apache.tools.ant.types.Path
|
createSourcepath()
Adds a path to sourcepath. |
org.apache.tools.ant.types.Path
|
createSrc()
Adds a path for source compilation. |
void
|
execute()
Executes the task. |
org.apache.tools.ant.types.Path
|
getClasspath()
Gets the classpath to be used for this compilation. |
java.io.File
|
getDestdir()
Gets the destination directory into which the java source files should be compiled. |
java.lang.String
|
getEncoding()
Returns the encoding to be used when creating files. |
java.lang.String
|
getExecutable()
The value of the executable attribute, if any. |
boolean
|
getFailonerror()
Gets the failonerror flag. |
java.io.File[]
|
getFileList()
Gets the list of files to be compiled. |
boolean
|
getIncludeantruntime()
Gets whether or not the ant classpath is to be included in the classpath. |
boolean
|
getIncludejavaruntime()
Gets whether or not the java runtime should be included in this task's classpath. |
boolean
|
getIndy()
|
boolean
|
getKeepStubs()
|
boolean
|
getListfiles()
Get the listfiles flag. |
java.lang.String
|
getMemoryInitialSize()
Gets the memoryInitialSize flag. |
java.lang.String
|
getMemoryMaximumSize()
Gets the memoryMaximumSize flag. |
java.lang.String
|
getScriptExtension()
Get the extension to use when searching for Groovy source files. |
org.apache.tools.ant.types.Path
|
getSourcepath()
Gets the sourcepath to be used for this compilation. |
org.apache.tools.ant.types.Path
|
getSrcdir()
Gets the source dirs to find the source java files. |
java.io.File
|
getStubdir()
Gets the keepStubs flag. |
java.lang.String
|
getTargetBytecode()
Retrieves the compiler bytecode compatibility mode. |
boolean
|
getTaskSuccess()
Get the result of the groovyc task (success or failure). |
boolean
|
getVerbose()
Gets the verbose flag. |
boolean
|
isIncludeDestClasses()
Get the value of the includeDestClasses property. |
protected CompilationUnit
|
makeCompileUnit()
|
protected org.apache.tools.ant.types.Path
|
recreateSrc()
Recreate src. |
protected void
|
resetFileLists()
Clear the list of files to be compiled and copied.. |
protected void
|
scanDir(java.io.File srcDir, java.io.File destDir, java.lang.String[] files)
Scans the directory looking for source files to be compiled. |
void
|
setClasspath(org.apache.tools.ant.types.Path classpath)
Set the classpath to be used for this compilation. |
void
|
setClasspathRef(Reference r)
Adds a reference to a classpath defined elsewhere. |
void
|
setDestdir(java.io.File destDir)
Set the destination directory into which the Java source files should be compiled. |
void
|
setEncoding(java.lang.String encoding)
Sets the file encoding for generated files. |
void
|
setErrorProperty(java.lang.String errorProperty)
The property to set on compilation failure. |
void
|
setExecutable(java.lang.String forkExecPath)
Sets the name of the java executable to use when invoking the compiler in forked mode, ignored otherwise. |
void
|
setFailonerror(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true. |
void
|
setFork(boolean f)
If true forks the Groovy compiler. |
void
|
setIncludeDestClasses(boolean includeDestClasses)
This property controls whether to include the destination classes directory in the classpath given to the compiler. |
void
|
setIncludeantruntime(boolean include)
If true, includes Ant's own classpath in the classpath. |
void
|
setIncludejavaruntime(boolean include)
If true, includes the Java runtime libraries in the classpath. |
void
|
setIndy(boolean useIndy)
Get the value of the indy flag. |
void
|
setJavaHome(java.io.File home)
The JDK Home to use when forked. |
void
|
setKeepStubs(boolean keepStubs)
|
void
|
setListfiles(boolean list)
If true, list the source files being handed off to the compiler. |
void
|
setMemoryInitialSize(java.lang.String memoryInitialSize)
The initial size of the memory for the underlying VM if javac is run externally; ignored otherwise. |
void
|
setMemoryMaximumSize(java.lang.String memoryMaximumSize)
The maximum size of the memory for the underlying VM if javac is run externally; ignored otherwise. |
void
|
setProceed(boolean proceed)
@param proceed inverse of failonerror |
void
|
setScriptExtension(java.lang.String scriptExtension)
Set the extension to use when searching for Groovy source files. |
void
|
setSourcepath(org.apache.tools.ant.types.Path sourcepath)
Set the sourcepath to be used for this compilation. |
void
|
setSourcepathRef(Reference r)
Adds a reference to a source path defined elsewhere. |
void
|
setSrcdir(org.apache.tools.ant.types.Path srcDir)
Set the source directories to find the source Java files. |
void
|
setStacktrace(boolean stacktrace)
Enable compiler to report stack trace information if a problem occurs during compilation. |
void
|
setStubdir(java.io.File stubDir)
Set the stub directory into which the Java source stub files should be generated. |
void
|
setTargetBytecode(java.lang.String version)
Sets the bytecode compatibility mode |
void
|
setUpdatedProperty(java.lang.String updatedProperty)
The property to set on compilation success. |
void
|
setVerbose(boolean verbose)
Enable verbose compiling which will display which files are being compiled. |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask | |
---|---|
org.apache.tools.ant.taskdefs.MatchingTask#add(org.apache.tools.ant.types.selectors.FileSelector), org.apache.tools.ant.taskdefs.MatchingTask#XsetItems(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#addDate(org.apache.tools.ant.types.selectors.DateSelector), org.apache.tools.ant.taskdefs.MatchingTask#setIncludes(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#setExcludes(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#setCaseSensitive(boolean), org.apache.tools.ant.taskdefs.MatchingTask#setFollowSymlinks(boolean), org.apache.tools.ant.taskdefs.MatchingTask#setProject(org.apache.tools.ant.Project), org.apache.tools.ant.taskdefs.MatchingTask#addSize(org.apache.tools.ant.types.selectors.SizeSelector), org.apache.tools.ant.taskdefs.MatchingTask#addDifferent(org.apache.tools.ant.types.selectors.DifferentSelector), org.apache.tools.ant.taskdefs.MatchingTask#addFilename(org.apache.tools.ant.types.selectors.FilenameSelector), org.apache.tools.ant.taskdefs.MatchingTask#addType(org.apache.tools.ant.types.selectors.TypeSelector), org.apache.tools.ant.taskdefs.MatchingTask#addCustom(org.apache.tools.ant.types.selectors.ExtendSelector), org.apache.tools.ant.taskdefs.MatchingTask#addContains(org.apache.tools.ant.types.selectors.ContainsSelector), org.apache.tools.ant.taskdefs.MatchingTask#addPresent(org.apache.tools.ant.types.selectors.PresentSelector), org.apache.tools.ant.taskdefs.MatchingTask#addDepth(org.apache.tools.ant.types.selectors.DepthSelector), org.apache.tools.ant.taskdefs.MatchingTask#addDepend(org.apache.tools.ant.types.selectors.DependSelector), org.apache.tools.ant.taskdefs.MatchingTask#addContainsRegexp(org.apache.tools.ant.types.selectors.ContainsRegexpSelector), org.apache.tools.ant.taskdefs.MatchingTask#addModified(org.apache.tools.ant.types.selectors.modifiedselector.ModifiedSelector), org.apache.tools.ant.taskdefs.MatchingTask#hasSelectors(), org.apache.tools.ant.taskdefs.MatchingTask#XsetIgnore(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#selectorCount(), org.apache.tools.ant.taskdefs.MatchingTask#getSelectors(org.apache.tools.ant.Project), org.apache.tools.ant.taskdefs.MatchingTask#selectorElements(), org.apache.tools.ant.taskdefs.MatchingTask#appendSelector(org.apache.tools.ant.types.selectors.FileSelector), org.apache.tools.ant.taskdefs.MatchingTask#addSelector(org.apache.tools.ant.types.selectors.SelectSelector), org.apache.tools.ant.taskdefs.MatchingTask#addAnd(org.apache.tools.ant.types.selectors.AndSelector), org.apache.tools.ant.taskdefs.MatchingTask#addOr(org.apache.tools.ant.types.selectors.OrSelector), org.apache.tools.ant.taskdefs.MatchingTask#addNot(org.apache.tools.ant.types.selectors.NotSelector), org.apache.tools.ant.taskdefs.MatchingTask#addNone(org.apache.tools.ant.types.selectors.NoneSelector), org.apache.tools.ant.taskdefs.MatchingTask#addMajority(org.apache.tools.ant.types.selectors.MajoritySelector), org.apache.tools.ant.taskdefs.MatchingTask#createInclude(), org.apache.tools.ant.taskdefs.MatchingTask#createIncludesFile(), org.apache.tools.ant.taskdefs.MatchingTask#createExclude(), org.apache.tools.ant.taskdefs.MatchingTask#createExcludesFile(), org.apache.tools.ant.taskdefs.MatchingTask#setIncludesfile(java.io.File), org.apache.tools.ant.taskdefs.MatchingTask#setExcludesfile(java.io.File), org.apache.tools.ant.taskdefs.MatchingTask#setDefaultexcludes(boolean), org.apache.tools.ant.taskdefs.MatchingTask#createPatternSet(), org.apache.tools.ant.taskdefs.MatchingTask#log(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#log(java.lang.String, int), org.apache.tools.ant.taskdefs.MatchingTask#log(java.lang.Throwable, int), org.apache.tools.ant.taskdefs.MatchingTask#log(java.lang.String, java.lang.Throwable, int), org.apache.tools.ant.taskdefs.MatchingTask#init(), org.apache.tools.ant.taskdefs.MatchingTask#execute(), org.apache.tools.ant.taskdefs.MatchingTask#getTaskName(), org.apache.tools.ant.taskdefs.MatchingTask#setTaskName(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#getTaskType(), org.apache.tools.ant.taskdefs.MatchingTask#maybeConfigure(), org.apache.tools.ant.taskdefs.MatchingTask#setTaskType(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#getOwningTarget(), org.apache.tools.ant.taskdefs.MatchingTask#setOwningTarget(org.apache.tools.ant.Target), org.apache.tools.ant.taskdefs.MatchingTask#getRuntimeConfigurableWrapper(), org.apache.tools.ant.taskdefs.MatchingTask#setRuntimeConfigurableWrapper(org.apache.tools.ant.RuntimeConfigurable), org.apache.tools.ant.taskdefs.MatchingTask#reconfigure(), org.apache.tools.ant.taskdefs.MatchingTask#perform(), org.apache.tools.ant.taskdefs.MatchingTask#bindToOwner(org.apache.tools.ant.Task), org.apache.tools.ant.taskdefs.MatchingTask#clone(), org.apache.tools.ant.taskdefs.MatchingTask#getLocation(), org.apache.tools.ant.taskdefs.MatchingTask#getDescription(), org.apache.tools.ant.taskdefs.MatchingTask#setLocation(org.apache.tools.ant.Location), org.apache.tools.ant.taskdefs.MatchingTask#setDescription(java.lang.String), org.apache.tools.ant.taskdefs.MatchingTask#getProject(), org.apache.tools.ant.taskdefs.MatchingTask#wait(long), org.apache.tools.ant.taskdefs.MatchingTask#wait(long, int), org.apache.tools.ant.taskdefs.MatchingTask#wait(), org.apache.tools.ant.taskdefs.MatchingTask#equals(java.lang.Object), org.apache.tools.ant.taskdefs.MatchingTask#toString(), org.apache.tools.ant.taskdefs.MatchingTask#hashCode(), org.apache.tools.ant.taskdefs.MatchingTask#getClass(), org.apache.tools.ant.taskdefs.MatchingTask#notify(), org.apache.tools.ant.taskdefs.MatchingTask#notifyAll() |
Methods inherited from class org.apache.tools.ant.Task | |
---|---|
org.apache.tools.ant.Task#log(java.lang.String), org.apache.tools.ant.Task#log(java.lang.String, int), org.apache.tools.ant.Task#log(java.lang.Throwable, int), org.apache.tools.ant.Task#log(java.lang.String, java.lang.Throwable, int), org.apache.tools.ant.Task#init(), org.apache.tools.ant.Task#execute(), org.apache.tools.ant.Task#getTaskName(), org.apache.tools.ant.Task#setTaskName(java.lang.String), org.apache.tools.ant.Task#getTaskType(), org.apache.tools.ant.Task#maybeConfigure(), org.apache.tools.ant.Task#setTaskType(java.lang.String), org.apache.tools.ant.Task#getOwningTarget(), org.apache.tools.ant.Task#setOwningTarget(org.apache.tools.ant.Target), org.apache.tools.ant.Task#getRuntimeConfigurableWrapper(), org.apache.tools.ant.Task#setRuntimeConfigurableWrapper(org.apache.tools.ant.RuntimeConfigurable), org.apache.tools.ant.Task#reconfigure(), org.apache.tools.ant.Task#perform(), org.apache.tools.ant.Task#bindToOwner(org.apache.tools.ant.Task), org.apache.tools.ant.Task#clone(), org.apache.tools.ant.Task#getLocation(), org.apache.tools.ant.Task#getDescription(), org.apache.tools.ant.Task#setLocation(org.apache.tools.ant.Location), org.apache.tools.ant.Task#setDescription(java.lang.String), org.apache.tools.ant.Task#getProject(), org.apache.tools.ant.Task#setProject(org.apache.tools.ant.Project), org.apache.tools.ant.Task#wait(long), org.apache.tools.ant.Task#wait(long, int), org.apache.tools.ant.Task#wait(), org.apache.tools.ant.Task#equals(java.lang.Object), org.apache.tools.ant.Task#toString(), org.apache.tools.ant.Task#hashCode(), org.apache.tools.ant.Task#getClass(), org.apache.tools.ant.Task#notify(), org.apache.tools.ant.Task#notifyAll() |
Field Detail |
---|
protected java.io.File[] compileList
protected CompilerConfiguration configuration
protected boolean failOnError
protected boolean listFiles
Method Detail |
---|
public void addConfiguredJavac(org.apache.tools.ant.taskdefs.Javac javac)
protected void addToCompileList(java.io.File[] newFiles)
protected GroovyClassLoader buildClassLoaderFor()
protected void checkParameters()
protected void compile()
public org.apache.tools.ant.types.Path createClasspath()
public org.apache.tools.ant.types.Path createSourcepath()
public org.apache.tools.ant.types.Path createSrc()
public void execute()
public org.apache.tools.ant.types.Path getClasspath()
public java.io.File getDestdir()
public java.lang.String getEncoding()
public java.lang.String getExecutable()
public boolean getFailonerror()
public java.io.File[] getFileList()
public boolean getIncludeantruntime()
public boolean getIncludejavaruntime()
public boolean getIndy()
public boolean getKeepStubs()
public boolean getListfiles()
public java.lang.String getMemoryInitialSize()
public java.lang.String getMemoryMaximumSize()
public java.lang.String getScriptExtension()
public org.apache.tools.ant.types.Path getSourcepath()
public org.apache.tools.ant.types.Path getSrcdir()
public java.io.File getStubdir()
public java.lang.String getTargetBytecode()
public boolean getTaskSuccess()
public boolean getVerbose()
public boolean isIncludeDestClasses()
protected CompilationUnit makeCompileUnit()
protected org.apache.tools.ant.types.Path recreateSrc()
protected void resetFileLists()
protected void scanDir(java.io.File srcDir, java.io.File destDir, java.lang.String[] files)
srcDir
- The source directorydestDir
- The destination directoryfiles
- An array of filenames
public void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- an Ant Path object containing the compilation classpath.
public void setClasspathRef(Reference r)
r
- a reference to a classpath
public void setDestdir(java.io.File destDir)
destDir
- the destination director
public void setEncoding(java.lang.String encoding)
encoding
- the file encoding to be used
public void setErrorProperty(java.lang.String errorProperty)
errorProperty
- the property name to use.
public void setExecutable(java.lang.String forkExecPath)
forkExecPath
- the name of the executable
public void setFailonerror(boolean fail)
fail
- if true halt the build on failure
public void setFork(boolean f)
f
- "true|false|on|off|yes|no"
public void setIncludeDestClasses(boolean includeDestClasses)
includeDestClasses
- the value to use.
public void setIncludeantruntime(boolean include)
include
- if true, includes Ant's own classpath in the classpath
public void setIncludejavaruntime(boolean include)
include
- if true, includes the Java runtime libraries in the classpath
public void setIndy(boolean useIndy)
public void setJavaHome(java.io.File home)
home
- the java.home value to use, default is the current JDK's home
public void setKeepStubs(boolean keepStubs)
public void setListfiles(boolean list)
list
- if true list the source files
public void setMemoryInitialSize(java.lang.String memoryInitialSize)
memoryInitialSize
- string to pass to VM
public void setMemoryMaximumSize(java.lang.String memoryMaximumSize)
memoryMaximumSize
- string to pass to VM
public void setProceed(boolean proceed)
proceed
- inverse of failonerror
public void setScriptExtension(java.lang.String scriptExtension)
scriptExtension
- the extension of Groovy source files
public void setSourcepath(org.apache.tools.ant.types.Path sourcepath)
sourcepath
- the source path
public void setSourcepathRef(Reference r)
r
- a reference to a source path
public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
srcDir
- the source directories as a path
public void setStacktrace(boolean stacktrace)
public void setStubdir(java.io.File stubDir)
stubDir
- the stub directory
public void setTargetBytecode(java.lang.String version)
version
- the bytecode compatibility mode
public void setUpdatedProperty(java.lang.String updatedProperty)
updatedProperty
- the property name to use.
public void setVerbose(boolean verbose)
Groovy Documentation