public class TargetLister extends Object
Note that scripts may import other scripts using
the <import>
pseudotask, so you may need
to use TargetLister.Target.getScript()
to check which script a target came from.
Warning: the implementation attempts to handle
import statements which use Ant properties in the imported file name, but
it is not possible to determine what the value of the file path will actually
be at runtime with complete accuracy. If the import location cannot be resolved,
an IOException
may be thrown or that import may simply be skipped.
The imported file path is considered relative to the project base directory, hopefully according to Ant's own rules.
If an import statement is marked as optional, and the imported script cannot
be found, it will be silently skipped (as Ant does). If it is marked as mandatory
(the default), this situation will result in an IOException
.
Modifier and Type | Class and Description |
---|---|
static class |
TargetLister.Target
Representation of a target from an Ant script.
|
Modifier and Type | Method and Description |
---|---|
static Set<TargetLister.Target> |
getTargets(AntProjectCookie script)
Gets all targets in an Ant script.
|
public static Set<TargetLister.Target> getTargets(AntProjectCookie script) throws IOException
TargetLister.Target
objects will be
the same from call to call.script
- an Ant build scriptTargetLister.Target
s; may be emptyIOException
- in case there is a problem reading the script (or a subscript)