Package net.jangaroo.jooc.ant
Class JoocTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.apache.tools.ant.taskdefs.MatchingTask
-
- net.jangaroo.jooc.ant.JoocTask
-
- All Implemented Interfaces:
Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
public class JoocTask extends org.apache.tools.ant.taskdefs.MatchingTask- Author:
- Andreas Gawecki
-
-
Constructor Summary
Constructors Constructor Description JoocTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckParameters()Check that all required attributes have been set and nothing silly has been entered.protected voidcompile()Perform the compilation.org.apache.tools.ant.types.PathcreateSrc()Adds a path for source compilation.voidexecute()Executes the task.FilegetApiDestDir()StringgetAutoSemicolon()StringgetClasspath()Get the classpath to find joo library files.StringgetDebugLevel()FilegetDestdir()Get the destination directory into which the java source files should be compiled.booleangetEnableAssertions()booleangetFailonerror()Gets the failonerror flag.File[]getFileList()Gets the list of files to be compiled.org.apache.tools.ant.types.PathgetSrcdir()Get the source dirs to find the source java files.booleangetVerbose()Gets the verbose flag.booleanisAllowduplicatelocalvariables()Gets the allowduplicatelocalvariables flag.org.apache.tools.ant.types.PathrecreateSrc()Recreate src.protected voidscanDir(File srcDir, File destDir, String[] files)Scans the directory looking for source files to be compiled.voidsetAllowduplicatelocalvariables(boolean allowduplicatelocalvariables)Sets the allowduplicatelocalvariables flag.voidsetApiDestDir(File apiDestDir)voidsetAutoSemicolon(String autoSemicolon)voidsetClasspath(String classpath)Set the classpath to find the joo library files.voidsetDebugLevel(String debugLevel)voidsetDestdir(File destDir)Set the destination directory into which the Java source files should be compiled.voidsetEnableAssertions(boolean enableAssertions)voidsetFailonerror(boolean fail)Indicates whether the build will continue even if there are compilation errors; defaults to true.voidsetSrcdir(org.apache.tools.ant.types.Path srcDir)Set the source directories to find the source joo files.voidsetVerbose(boolean verbose)If true, asks the compiler for verbose output.-
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
-
-
-
-
Method Detail
-
getEnableAssertions
public boolean getEnableAssertions()
-
setEnableAssertions
public void setEnableAssertions(boolean enableAssertions)
-
getApiDestDir
public File getApiDestDir()
-
setApiDestDir
public void setApiDestDir(File apiDestDir)
-
createSrc
public org.apache.tools.ant.types.Path createSrc()
Adds a path for source compilation.- Returns:
- a nested src element.
-
recreateSrc
public org.apache.tools.ant.types.Path recreateSrc()
Recreate src.- Returns:
- a nested src element.
-
setSrcdir
public void setSrcdir(org.apache.tools.ant.types.Path srcDir)
Set the source directories to find the source joo files.- Parameters:
srcDir- the source directories
-
getSrcdir
public org.apache.tools.ant.types.Path getSrcdir()
Get the source dirs to find the source java files.- Returns:
- the source directories
-
setClasspath
public void setClasspath(String classpath)
Set the classpath to find the joo library files.- Parameters:
classpath- the classpath
-
getClasspath
public String getClasspath()
Get the classpath to find joo library files.- Returns:
- the classpath
-
setDestdir
public void setDestdir(File destDir)
Set the destination directory into which the Java source files should be compiled.- Parameters:
destDir- the destination directory
-
getDestdir
public File getDestdir()
Get the destination directory into which the java source files should be compiled.- Returns:
- the destination directory
-
setFailonerror
public void setFailonerror(boolean fail)
Indicates whether the build will continue even if there are compilation errors; defaults to true.- Parameters:
fail- whether to fail on errors
-
getFailonerror
public boolean getFailonerror()
Gets the failonerror flag.- Returns:
- whether to fail on errors
-
isAllowduplicatelocalvariables
public boolean isAllowduplicatelocalvariables()
Gets the allowduplicatelocalvariables flag.- Returns:
- the allowduplicatelocalvariables flag
-
setAllowduplicatelocalvariables
public void setAllowduplicatelocalvariables(boolean allowduplicatelocalvariables)
Sets the allowduplicatelocalvariables flag.- Parameters:
allowduplicatelocalvariables- the allowduplicatelocalvariables flag
-
getDebugLevel
public String getDebugLevel()
-
setDebugLevel
public void setDebugLevel(String debugLevel)
-
setVerbose
public void setVerbose(boolean verbose)
If true, asks the compiler for verbose output.- Parameters:
verbose- the verbose state
-
getVerbose
public boolean getVerbose()
Gets the verbose flag.- Returns:
- the verbose state
-
getAutoSemicolon
public String getAutoSemicolon()
-
setAutoSemicolon
public void setAutoSemicolon(String autoSemicolon)
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionExecutes the task.- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
scanDir
protected void scanDir(File srcDir, File destDir, String[] files)
Scans the directory looking for source files to be compiled. The results are returned in the class variable compileList- Parameters:
srcDir- the source directorydestDir- the destination directoryfiles- the files to scan
-
getFileList
public File[] getFileList()
Gets the list of files to be compiled.- Returns:
- the list of files to be compiled
-
checkParameters
protected void checkParameters() throws org.apache.tools.ant.BuildExceptionCheck that all required attributes have been set and nothing silly has been entered.- Throws:
org.apache.tools.ant.BuildException- when a build error occurred- Since:
- Ant 1.5
-
compile
protected void compile()
Perform the compilation.- Since:
- Ant 1.5
-
-