WeaverFileList

Description

This task is similar to WeaverFileSet, except instead of storing the artifacts in an Ant FileSet variable, files are stored in a comma-delimited string. The motivation for using this task is that FileSets do not preserve ordering. It is sometimes useful to obtain a list of artifacts sorted in dependency order (e.g. to build projects in the order of dependency).

Note: the comma-delimited list of files will be relative paths, relative the ‘dir’ attribute declared in the WeaverProjects task.

Parameters

Attribute

Description

Required

property

Name of Ant property to instantiate.

Yes

type

This specifies the type of artifact that the FileSet will contain. This value corresponds to the ‘type’ attribute for the ‘artifact’ nested element in WeaverProjects task.

Yes

project

This specifies the root project that will be used to obtain the artifacts. Starting at this root, the dependency graph will traversed and all artifacts of all project dependencies will be included in the FileSet.

If set to ‘true’, then the FileSet created will include artifacts for the declared project. Otherwise, the FileSet will only contain artifacts for the dependency projects of the declared project. This attribute is ignored if the ‘project’ attribute is not declared.

No. Defaults to ‘false’.

Examples

All of the examples below assume that the following WeaverProjects task instantiation has been declared:

The call to ‘WeaverFileList’ creates an Ant property variable with the name ‘server.build.files’. A call to Ant-Contrib task ‘for’ is used to iterate over this property, outputing the absolute path of ‘common/build.xml’ to the screen. The ‘server/build.xml’ file is not displayed, since the optional attribute ‘inclusive’ has not been set, and by default it is ‘false’.

This example is similar to the previous one, except we’re specifying ‘type’ equal to ‘jar’, rather than ‘build.files’. Also, we’ve set ‘inclusive’ to ‘true’. The result is that the absolute paths of ‘common.jar’ and ‘server.jar’ will be displayed.

Example 3

In this example, the ‘project’ attribute is not declared. This causes the ‘WeaverFileList’ to include all projects. The result is that the absolute paths of the build files for all three projects will be output.