public abstract class CompileTaskSupport
extends MatchingTask
Support for compilation related tasks.
| Modifiers | Name | Description |
|---|---|---|
protected Path |
classpath |
Compilation classpath. |
protected CompilerConfiguration |
config |
Compiler configuration shared with the concrete task implementation. |
protected File |
destdir |
Destination directory for generated output. |
protected boolean |
failOnError |
Whether task failures should stop the Ant build. |
protected LoggingHelper |
log |
Logger used by subclasses to report task progress. |
protected Path |
src |
Source roots to scan for compilation inputs. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected abstract void |
compile()Performs the concrete compilation work for the task. |
|
protected GroovyClassLoader |
createClassLoader()Creates a class loader for the current compiler configuration and classpath. |
|
public Path |
createClasspath()Creates a nested <classpath> path element. |
|
public CompilerConfiguration |
createConfiguration()Returns the mutable compiler configuration used by this task. |
|
public Path |
createSrc()Creates a nested <src> path element. |
|
public void |
execute()Validates the task and delegates to compile(). |
|
public Path |
getClasspath()Returns the configured compilation classpath. |
|
public boolean |
getFailonerror()Indicates whether compilation errors fail the Ant build. |
|
public Path |
getSrcdir()Returns the configured source roots. |
|
protected void |
handleException(Exception e)Converts a compilation failure into the Ant task's configured error handling. |
|
public void |
setClasspath(Path path)Adds entries to the compilation classpath. |
|
public void |
setClasspathRef(Reference r)Adds a reference to a classpath defined elsewhere. |
|
public void |
setDestdir(File dir)Sets the output directory for generated classes or stubs. |
|
public void |
setFailonerror(boolean fail)Controls whether compilation errors should fail the Ant build. |
|
public void |
setSrcdir(Path dir)Adds source roots to the task. |
|
protected void |
validate()Validates the task configuration before compilation starts. |
| Methods inherited from class | Name |
|---|---|
class MatchingTask |
XsetIgnore, XsetItems, add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addFilename, addMajority, addModified, addNone, addNot, addOr, addPresent, addSelector, addSize, addType, appendSelector, bindToOwner, clone, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, equals, execute, getClass, getDescription, getLocation, getOwningTarget, getProject, getRuntimeConfigurableWrapper, getSelectors, getTaskName, getTaskType, hasSelectors, hashCode, init, log, log, log, log, maybeConfigure, notify, notifyAll, perform, reconfigure, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setDescription, setExcludes, setExcludesfile, setFollowSymlinks, setIncludes, setIncludesfile, setLocation, setOwningTarget, setProject, setRuntimeConfigurableWrapper, setTaskName, setTaskType, toString, wait, wait, wait |
Compilation classpath.
Compiler configuration shared with the concrete task implementation.
Destination directory for generated output.
Whether task failures should stop the Ant build.
Logger used by subclasses to report task progress.
Source roots to scan for compilation inputs.
Performs the concrete compilation work for the task.
Creates a class loader for the current compiler configuration and classpath.
Creates a nested <classpath> path element.
Returns the mutable compiler configuration used by this task.
Creates a nested <src> path element.
Validates the task and delegates to compile().
Returns the configured compilation classpath.
Indicates whether compilation errors fail the Ant build.
true if failures abort the buildReturns the configured source roots.
Converts a compilation failure into the Ant task's configured error handling.
e - the exception raised by compilationAdds entries to the compilation classpath.
path - the classpath entries to appendAdds a reference to a classpath defined elsewhere.
r - the classpath referenceSets the output directory for generated classes or stubs.
dir - the destination directoryControls whether compilation errors should fail the Ant build.
fail - true to fail the build on compilation errorsAdds source roots to the task.
dir - the source path to appendValidates the task configuration before compilation starts.