|
|||||||||
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.MatchingTask
org.codehaus.groovy.ant.Groovyc
public class Groovyc
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 File[] |
compileList
|
protected CompilerConfiguration |
configuration
|
protected File |
destDir
|
protected boolean |
failOnError
|
protected boolean |
listFiles
|
protected Path |
src
|
Fields inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
---|
fileset |
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 | |
---|---|
Groovyc()
|
Method Summary | |
---|---|
protected void |
addToCompileList(File[] newFiles)
|
protected GroovyClassLoader |
buildClassLoaderFor()
|
protected void |
checkParameters()
|
protected void |
compile()
|
Path |
createClasspath()
Adds a path to the classpath. |
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") |
Javac |
createJavac()
|
Path |
createSourcepath()
Adds a path to sourcepath. |
Path |
createSrc()
Adds a path for source compilation. |
protected File |
createTempDir()
|
void |
execute()
Executes the task. |
Path |
getClasspath()
Gets the classpath to be used for this compilation. |
File |
getDestdir()
Gets the destination directory into which the java source files should be compiled. |
String |
getEncoding()
Returns the encoding to be used when creating files. |
boolean |
getFailonerror()
Gets the failonerror flag. |
File[] |
getFileList()
Gets the list of files to be compiled. |
boolean |
getListfiles()
Get the listfiles flag. |
Path |
getSourcepath()
Gets the sourcepath to be used for this compilation. |
Path |
getSrcdir()
Gets the source dirs to find the source java files. |
static void |
main(String[] args)
|
protected CompilationUnit |
makeCompileUnit()
|
protected Path |
recreateSrc()
Recreate src. |
protected void |
resetFileLists()
Clear the list of files to be compiled and copied.. |
protected void |
scanDir(File srcDir,
File destDir,
String[] files)
Scans the directory looking for source files to be compiled. |
void |
setClasspath(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(File destDir)
Set the destination directory into which the Java source files should be compiled. |
void |
setEncoding(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(String options)
|
void |
setListfiles(boolean list)
If true, list the source files being handed off to the compiler. |
void |
setProceed(boolean proceed)
|
void |
setSourcepath(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(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 |
Methods inherited from class org.apache.tools.ant.taskdefs.MatchingTask |
---|
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 |
Methods inherited from class org.apache.tools.ant.Task |
---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, 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 |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected File destDir
protected Path src
protected CompilerConfiguration configuration
protected boolean failOnError
protected boolean listFiles
protected File[] compileList
Constructor Detail |
---|
public Groovyc()
Method Detail |
---|
public static void main(String[] args)
public Path createSrc()
protected Path recreateSrc()
public void setSrcdir(Path srcDir)
srcDir
- the source directories as a pathpublic Path getSrcdir()
public void setDestdir(File destDir)
destDir
- the destination directorpublic void setVerbose(boolean verbose)
public void setStacktrace(boolean stacktrace)
public File getDestdir()
public void setSourcepath(Path sourcepath)
sourcepath
- the source pathpublic Path getSourcepath()
public Path createSourcepath()
public void setSourcepathRef(Reference r)
r
- a reference to a source pathpublic void setClasspath(Path classpath)
classpath
- an Ant Path object containing the compilation classpath.public Path getClasspath()
public Path createClasspath()
public void setClasspathRef(Reference r)
r
- a reference to a classpathpublic String createEncoding()
public void setEncoding(String encoding)
encoding
- the file encoding to be usedpublic 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 BuildException
execute
in class Task
BuildException
- if an error occursprotected void resetFileLists()
protected void scanDir(File srcDir, File destDir, String[] files)
srcDir
- The source directorydestDir
- The destination directoryfiles
- An array of filenamesprotected void addToCompileList(File[] newFiles)
public File[] getFileList()
protected void checkParameters() throws BuildException
BuildException
protected void compile()
protected CompilationUnit makeCompileUnit()
protected File createTempDir()
protected GroovyClassLoader buildClassLoaderFor()
public void setJointCompilationOptions(String options)
public Javac createJavac()
|
Copyright © 2003-2007 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |