- Documentation (2.5.3)
- Release Notes
- Tutorials
- Reference
- Introduction
- System Properties
- Settings Files
- Ivy Files
- Ant Tasks
- artifactproperty
- artifactreport
- buildlist
- buildnumber
- buildobr
- cachefileset
- cachepath
- checkdepsupdate
- cleancache
- configure
- convertmanifest
- convertpom
- deliver
- dependencytree
- findrevision
- fixdeps
- info
- install
- listmodules
- makepom
- post resolve tasks
- publish
- report
- repreport
- resolve
- resources
- retrieve
- settings
- var
- Using standalone
- OSGi
- Developer doc
buildlist
[since 1.2]
The buildlist task enables 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.
This is particularly useful combined with subant, to build a set of interrelated projects being sure that a dependency will be built before any module depending on it.
When the ivy.xml of the modules that you want to order doesn’t contain revision numbers, the rev attributes declared in the dependencies are not used.
When the ivy.xml of the modules that you want to order contains revision numbers, the revision numbers are used. If the revision number doesn’t match a dependency description, a warning is logged and the modules are considered to be different modules.
(since 1.3) A root attribute can also be used to include, among all the modules found, only the ones 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 ones 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 Ant project 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.
(since 2.5) The root and leaf modules can also be specified as nested root and leaf elements. This way, not only the module name can be specified, but also the organisation, revision and branch of the root/leaf.
By default, all the modules included in a circular dependency are grouped together so that any dependency of any module in the loop will appear before the modules in the loop. This guarantees that if there is a dependency path between a module A and a module B (but no dependency path from B to A), B will always appear before A even if A is included in a loop in the provided set of modules to sort.
Note that a circular dependency can also trigger a failure depending on the value configured in the circularDependencyStrategy of your settings
When you are specifying root or leaf modules you can limit the resulting list to only direct dependencies of the root modules or to modules that directly depends on your leaf modules.
You can also specify a restartFrom modules. The difference with root or leaf is that you get a list starting at the restartFrom module followed by all the modules that would be after if the parameter would not be there (even if there is no dependency between the restartFrom and the following module).
Attributes
| 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 |
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) |
No. Defaults to |
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) |
onlydirectdep |
(since 2.0) This field is ignored when neither root nor leaf is filled. |
No. Defaults to no |
delimiter |
(since 2.0) delimiter to use when specifying multiple module names in the root and leaf properties. |
No. Defaults to the comma ( |
excludeleaf |
(since 1.4.1) |
No. Defaults to |
haltonerror |
|
No. Defaults to |
skipbuildwithoutivy |
Deprecated, use |
No. Defaults to |
onMissingDescriptor |
(since 2.0) Specify the action to take when no module descriptor file is found for a file of the fileset. Possible values are: |
No. Defaults to |
reverse |
|
No. Defaults to default |
restartFrom |
(since 2.0) The name of the module which should be considered as the starting point in the buildlist. This allows for the build to be started at any point in the dependency chain. |
No. Defaults to |
settingsRef |
(since 2.0) A reference to Ivy settings that must be used by this task |
No, |
Child elements
| Element | Description | Cardinality |
|---|---|---|
root |
(since 2.5) Declares a root module. This element takes the following attributes: |
0..n |
leaf |
(since 2.5) Declares a leaf module. This element takes the following attributes: |
0..n |
Parameters specified as nested elements
fileset
FileSets are used to select sets of files to order.
Examples
<ivy:buildlist reference="build-path">
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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).
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">
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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.
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" root="myapp">
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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.
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml" leaf="mymodule">
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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.
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml">
<root organisation="myorg" module="myapp" />
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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 myorg#myapp (either direct or transitive) are put in the result list.
<ivy:buildlist reference="build-path" ivyfilepath="ivy/ivy.xml">
<root file="/path/to/myapp-ivy.xml" />
<fileset dir="projects" includes="**/build.xml"/>
</ivy:buildlist>
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 defined in /path/to/myapp-ivy.xml (either direct or transitive) are put in the result list.
