buildlist
The buildlist task enable to obtain a filelist of files (usually build.xml files) ordered according to ivy dependency information from the least dependent to the most one, or the inverse. (since 1.2)
This is particularly useful combined with subant, to build a set of interelated projects being sure that a dependency will be built before any module depending on it.
since 1.3 A root attribute can also be used to include, among all the modules found, only the one that are dependencies (either direct or transitive) of a root module. This can also be used with the excluderoot attribute, which when set to true will exclude the root itself from the list.
since 1.4.1 A leaf attribute can also be used to include, among all the modules found, only the one that have dependencies (either direct or transitive) on a leaf module. This can also be used with the excludeleaf attribute, which when set to true will exclude the leaf itself from the list.
since 1.4 The ivy.sorted.modules property is set in the ant at the end of the task with a comma separated list of ordered modules. This can be useful for debug or information purpose.
since 2.0 The root and leaf attributes can be a delimited list of modules to use as roots. These modules, and all their dependencies will be included in the build list.
Attribute | Description | Required |
---|---|---|
reference | the reference of the path to set | Yes |
ivyfilepath | the relative path from files to order to corresponding ivy files | No. Defaults to ${ivy.buildlist.ivyfilepath} |
root | since 2.0 the names of the modules which should be considered as the root of the buildlist. since 1.3 Was limited to only one module name before 2.0. | No. Defaults to no root (all modules are used in the build list) |
excluderoot | since 1.3 true if the root defined should be excluded from the list | No. Defaults to false |
leaf | since 2.0 the names of the modules which should be considered as the leaf of the buildlist. since 1.4.1 Was limited to only one module name before 2.0. | No. Defaults to no leaf (all modules are used in the build list) |
delimiter | since 2.0 delimiter to use when specifying multiple module names in the root and leaf properties. | No. Defaults to the comma (,) character. |
excludeleaf | since 1.4.1 true if the leaf defined should be excluded from the list | No. Defaults to false |
haltonerror | true to halt the build when an invalid ivy file is encountered, false to continue | No. Defaults to true |
skipbuildwithoutivy | true to skip files of the fileset with no corresponding ivy file, false otherwise. If false the file with no corresponding ivy file will be considered as independent of the other and put at the beginning of the built filelist. | No. Defaults to false |
reverse | true to obtain the list in the reverse order, i.e. from the most dependent to the least one | No. Defaults to default false |
Parameters specified as nested elements
fileset
FileSets are used to select sets of files to order.Examples
<ivy:buildlist reference="build-path">Builds a list of build.xml files sorted according to the ivy.xml files found at the same level (the default value for ivyfilepath is ivy.xml).
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
This list can then be used like that:
<subant target="build" buildpathref="build-path" />
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" reverse="true">Builds a list of build.xml files sorted according to the ivy.xml files found in an ivy directory relative to those build files. The list is sorted from the most dependent to the least one.
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" root="myapp">Builds a list of build.xml files sorted according to the ivy.xml files found in an ivy directory relative to those build files. Only build.xml files of modules which are dependencies of myapp (either direct or transitive) are put in the result list.
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" leaf="mymodule">Builds a list of build.xml files sorted according to the ivy.xml files found in an ivy directory relative to those build files. Only build.xml files of modules which have dependencies (direct or transitive) on mymodule are put in the result list.
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
Printer Friendly