Package gosu.tools.ant
Class Gosuc
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.MatchingTask
gosu.tools.ant.GosuMatchingTask
gosu.tools.ant.Gosuc
- All Implemented Interfaces:
Cloneable,org.apache.tools.ant.types.selectors.SelectorContainer
Ant task for compiling Gosu files to disk.
The following parameters are available:
- "srcdir" : A Path containing one or more source directories
- "destdir" : A File representing the output destination of the compilation
- "checkedarithmetic" : Compile with checked arithmetic if true. Defaults to
false. - "failonerror" : Ignore compile errors and continue if true. Defaults to
true. - "projectname" : Outputs this value in the compilation complete message. Defaults to the empty string.
- "additionalscriptextensions" : Comma-separated list of additional file extensions to compile. Normally not required.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate org.apache.tools.ant.types.Pathprivate Fileprivate booleanprivate booleanprivate Stringprivate org.apache.tools.ant.types.Pathprivate final AntLoggingHelperFields inherited from class org.apache.tools.ant.taskdefs.MatchingTask
filesetFields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapperFields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts an array of relative String filenames to aList<File>org.apache.tools.ant.types.PathAdds a path to the classpath.org.apache.tools.ant.types.PathAdds a path for source compilation.voidexecute()Executes the task.Gets the destination directory into which the Gosu source files should be compiled.booleanGets the FailOnError flag.Gets the list of files to be compiled.Gets the optional Project Name.
This has no impact on the compilation; simply outputs this value in the compilation complete message.org.apache.tools.ant.types.PathGets the source dirs to find the source Gosu files.booleanbooleanisForce()Gets the Force flag.
ant's directory scanner is timestamp based.protected org.apache.tools.ant.types.PathRecreate src.protected voidScans the directory looking for source files to be compiled.voidsetAdditionalScriptExtensions(String extensions) voidsetCheckedArithmetic(boolean checkedArithmetic) voidsetClasspathRef(org.apache.tools.ant.types.Reference ref) Adds a reference to a classpath defined elsewhere.voidsetDestdir(File destDir) Set the destination directory into which the Gosu source files should be compiled.voidsetFailOnError(boolean fail) Indicates whether the build will continue even if there are compilation errors; defaults to true.voidsetForce(boolean force) voidsetProjectName(String projectName) voidsetSrcdir(org.apache.tools.ant.types.Path srcDir) Set the source directories to find the source Gosu files.Methods inherited from class gosu.tools.ant.GosuMatchingTask
buildErrorMethods 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, XsetItemsMethods 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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation
-
Field Details
-
log
-
_src
private org.apache.tools.ant.types.Path _src -
_destDir
-
_compileClasspath
private org.apache.tools.ant.types.Path _compileClasspath -
_failOnError
private boolean _failOnError -
_checkedArithmetic
private boolean _checkedArithmetic -
_force
private boolean _force -
_projectName
-
_scriptExtensions
-
compileList
-
-
Constructor Details
-
Gosuc
public Gosuc()
-
-
Method Details
-
createSrc
public org.apache.tools.ant.types.Path createSrc()Adds a path for source compilation.- Returns:
- a nested src element.
-
recreateSrc
protected 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 Gosu files.- Parameters:
srcDir- the source directories as a path
-
getSrcdir
public org.apache.tools.ant.types.Path getSrcdir()Gets the source dirs to find the source Gosu files.- Returns:
- the source directories as a path
-
setDestdir
Set the destination directory into which the Gosu source files should be compiled.- Parameters:
destDir- the destination directory
-
getDestdir
Gets the destination directory into which the Gosu source files should be compiled.- Returns:
- the destination directory
-
createClasspath
public org.apache.tools.ant.types.Path createClasspath()Adds a path to the classpath.- Returns:
- a classpath to be configured
-
setClasspathRef
public void setClasspathRef(org.apache.tools.ant.types.Reference ref) Adds a reference to a classpath defined elsewhere.- Parameters:
ref- a reference to a classpath
-
getScriptExtensions
-
setAdditionalScriptExtensions
- Parameters:
extensions- Additional extensions to compile; for example "grs, gr"
-
setFailOnError
public void setFailOnError(boolean fail) Indicates whether the build will continue even if there are compilation errors; defaults to true.- Parameters:
fail- if true halt the build on failure
-
getFailOnError
public boolean getFailOnError()Gets the FailOnError flag.- Returns:
- the FailOnError flag
-
isCheckedArithmetic
public boolean isCheckedArithmetic() -
setCheckedArithmetic
public void setCheckedArithmetic(boolean checkedArithmetic) -
isForce
public boolean isForce()Gets the Force flag.
ant's directory scanner is timestamp based. Without propertasks, this could result in successful, but incomplete compilation.
Therefore we default 'force' to true, which causes compilation of all matching source files, regardless of the timestamp comparison between source and target.- Returns:
-
setForce
public void setForce(boolean force) -
getProjectName
Gets the optional Project Name.
This has no impact on the compilation; simply outputs this value in the compilation complete message. Useful in large, multimodule builds with parallelization.- Returns:
- ProjectName property; defaults to empty string.
-
setProjectName
-
scanDir
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- An array of filenames
-
asFiles
Converts an array of relative String filenames to aList<File>- Parameters:
srcDir- The root directory of all filesfiles- All files are relative to srcDir- Returns:
- a List of Files by joining srcDir to each file
-
getFileList
Gets the list of files to be compiled.- Returns:
- the list of files
-
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- if an error occurs
-