public class AntTask extends AbstractElementWithOperands
The execution of tests and actions stops when one of them evaluates to false, i.e. they are implicitly
AND-related.
To use this task, add this to your ANT build script:
<taskdef
classpath="path/to/zz-find-x.y.z-jar-with-dependencies.jar"
resource="antlib.xml"
/>
| Modifier and Type | Class and Description |
|---|---|
static class |
AntTask.AndElement
Combines subexpressions logically: Evaluates its subexpressions sequentially; if one of them evaluates to
false, then the remaining subexpressions are not evaluated, and false is returned. |
static class |
AntTask.CatElement
Copies the contents of the current file to STDOUT and evaluates to TRUE.
|
static class |
AntTask.ChecksumElement
Calculates a "checksum" of the contents, prints it and returns true.
|
static class |
AntTask.CommaElement
Evaluates subexpressions sequentially; returns the value of the last subexpression.
|
static class |
AntTask.CopyElement
Copies the contents of the current file to the named file and evaluates to TRUE.
|
static class |
AntTask.DeleteElement
Delete file; Evaluates to
true if removal succeeded. |
static class |
AntTask.DigestElement
Calculates a "message digest" of the contents, prints it and returns true.
|
static class |
AntTask.DisassembleElement
Disassembles a Java .class file to STDOUT or a given file and evaluates to
true. |
static class |
AntTask.EchoElement
Prints a text and evaluates to
true. |
static class |
AntTask.ExecElement
Executes an external command; the special string '{}' within the command is replaced with the full path of the
current file/directory/archive entry.
|
static class |
AntTask.ExecutableElement
Evaluates to
true iff the current file/directory is executable. |
static interface |
AntTask.ExpressionElement |
static class |
AntTask.FalseElement
Evaluates to
false. |
static class |
AntTask.LsElement
Prints the file type ("
d" or "-"), readability ("r" or "-"), writability ("w" or "-"), executability ("x" or "-"), size, modification time and path, and evaluates
to true. |
static class |
AntTask.ModificationTimeElement
Checks the modification time of the current file or archive entry.
|
static class |
AntTask.NameElement
Evaluates to
true iff the name of the current file/directory/archive entry matches the given
glob. |
static class |
AntTask.NotElement
Negates its subelement expression.
|
static class |
AntTask.OrElement
Combines subexpressions logically: Evaluates its subexpressions sequentially; if one of them evaluates to
true, then the remaining subexpressions are not evaluated, and true is returned. |
static class |
AntTask.PathElement
Evaluates to
true iff the path of the current file/directory/archive entry matches the given
glob. |
static class |
AntTask.PipeElement
Copies the contents of the current file/archive entry to the STDIN of a command and returns whether the command
exited with status 0.
|
static class |
AntTask.PrintElement
Prints the path of the current file/directory/archive entry and evaluates to
true. |
static class |
AntTask.PropertyElement
Sets an ANT property.
|
static class |
AntTask.PruneElement
Evaluates to
true. |
static class |
AntTask.ReadableElement
Evaluates to
true iff the current file/directory is readable. |
static class |
AntTask.SizeElement
Checks the size of the current file or archive entry.
|
static class |
AntTask.TrueElement
Evaluates to
true. |
static class |
AntTask.TypeElement
Evaluates to whether the type of the current file/directory/archive entry matches.
|
static class |
AntTask.WritableElement
Evaluates to
true iff the current file/directory is writable. |
| Constructor and Description |
|---|
AntTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigured(AntTask.ExpressionElement operand)
Another expression that will be evaluated for each directory, file and archive entry.
|
void |
addConfigured(org.apache.tools.ant.types.ResourceCollection value)
Resources to examine.
|
void |
execute()
The ANT task "execute" method.
|
void |
setDescendantsFirst(boolean value)
Whether to process each directory's contents before the directory itself, and each archive's entries before
the archive itself, and each compressed contents before the enclosing file or archive entry.
|
void |
setDir(File directory)
Also examine the given directory.
|
void |
setFile(File file)
Also examine the given file.
|
void |
setLookInto(String value)
Archive files, nested archives, compressed files and nested compressed content are introspected iff the
archive/compression format and the file's (resp. nested archive entry's) path match the given globs.
|
void |
setMaxDepth(int levels)
Descend at most levels of directories below the top level files and directories.
|
void |
setMinDepth(int levels)
Do not apply any tests or actions at levels less than levels.
|
void |
setOutputFile(File file)
Print the output to the given file instead of STDOUT.
|
createSequentialpublic void setLookInto(String value)
The default is to look into any recognized archive and comressed content.
public void setDescendantsFirst(boolean value)
public void setMinDepth(int levels)
public void setMaxDepth(int levels)
public void setFile(File file)
setDir(File),
addConfigured(ResourceCollection)public void setDir(File directory)
setFile(File),
addConfigured(ResourceCollection)public void setOutputFile(File file)
public void addConfigured(AntTask.ExpressionElement operand)
addConfigured in class AbstractElementWithOperandspublic void addConfigured(org.apache.tools.ant.types.ResourceCollection value)
setFile(File),
setDir(File)public void execute()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildExceptionTask.execute()Copyright © 2019 Arno Unkrig. All rights reserved.