public class Groovyc
extends org.apache.tools.ant.taskdefs.MatchingTask
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
Modifier and Type | Field and Description |
---|---|
protected java.io.File[] |
compileList |
protected CompilerConfiguration |
configuration |
protected java.io.File |
destDir |
protected boolean |
failOnError |
protected boolean |
listFiles |
protected org.apache.tools.ant.types.Path |
src |
Constructor and Description |
---|
Groovyc() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkParameters() |
protected void |
compile() |
org.apache.tools.ant.types.Path |
createClasspath()
Adds a path to the classpath.
|
java.lang.String |
createEncoding()
Returns the encoding to be used when creating files.
If no encoding value has been set it will default to System.properties("file.encoding") |
org.apache.tools.ant.taskdefs.Javac |
createJavac() |
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.
|
protected java.io.File |
createTempDir() |
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.
|
boolean |
getFailonerror()
Gets the failonerror flag.
|
java.io.File[] |
getFileList()
Gets the list of files to be compiled.
|
boolean |
getListfiles()
Get the listfiles flag.
|
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.
|
static void |
main(java.lang.String[] args) |
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(org.apache.tools.ant.types.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 |
setFailonerror(boolean fail)
Indicates whether the build will continue
even if there are compilation errors; defaults to true.
|
void |
setJointCompilationOptions(java.lang.String options) |
void |
setListfiles(boolean list)
If true, list the source files being handed off to the compiler.
|
void |
setProceed(boolean proceed) |
void |
setSourcepath(org.apache.tools.ant.types.Path sourcepath)
Set the sourcepath to be used for this compilation.
|
void |
setSourcepathRef(org.apache.tools.ant.types.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 |
setVerbose(boolean verbose)
Enable verbose compiling which will display which files
are being compiled
|
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDirectoryScanner, getImplicitFileSet, getSelectors, hasSelectors, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setProject, XsetIgnore, XsetItems
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
protected java.io.File destDir
protected org.apache.tools.ant.types.Path src
protected CompilerConfiguration configuration
protected boolean failOnError
protected boolean listFiles
protected java.io.File[] compileList
public static void main(java.lang.String[] args)
public org.apache.tools.ant.types.Path createSrc()
protected org.apache.tools.ant.types.Path recreateSrc()
public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
srcDir
- the source directories as a pathpublic org.apache.tools.ant.types.Path getSrcdir()
public void setDestdir(java.io.File destDir)
destDir
- the destination directorpublic void setVerbose(boolean verbose)
public void setStacktrace(boolean stacktrace)
public java.io.File getDestdir()
public void setSourcepath(org.apache.tools.ant.types.Path sourcepath)
sourcepath
- the source pathpublic org.apache.tools.ant.types.Path getSourcepath()
public org.apache.tools.ant.types.Path createSourcepath()
public void setSourcepathRef(org.apache.tools.ant.types.Reference r)
r
- a reference to a source pathpublic void setClasspath(org.apache.tools.ant.types.Path classpath)
classpath
- an Ant Path object containing the compilation classpath.public org.apache.tools.ant.types.Path getClasspath()
public org.apache.tools.ant.types.Path createClasspath()
public void setClasspathRef(org.apache.tools.ant.types.Reference r)
r
- a reference to a classpathpublic java.lang.String createEncoding()
public void setEncoding(java.lang.String encoding)
encoding
- the file encoding to be usedpublic java.lang.String getEncoding()
public void setListfiles(boolean list)
list
- if true list the source filespublic boolean getListfiles()
public void setFailonerror(boolean fail)
fail
- if true halt the build on failurepublic void setProceed(boolean proceed)
proceed
- inverse of failonerrorpublic boolean getFailonerror()
public void execute() throws org.apache.tools.ant.BuildException
execute
in class org.apache.tools.ant.Task
org.apache.tools.ant.BuildException
- if an error occursprotected 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 filenamespublic java.io.File[] getFileList()
protected void checkParameters() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected void compile()
protected java.io.File createTempDir()
public void setJointCompilationOptions(java.lang.String options)
public org.apache.tools.ant.taskdefs.Javac createJavac()