Skip to Content

<executeProjectSet>

Scope: All Project Types

Description

The executeProjectSet task allows you iterate over a set of projects. The project set can be defined using a (comma separated) list of projects or a team project set file.

With the nested forEachProject element you can execute tasks for each project that is defined in the project set. The build order of the contained projects are computed automatically.

Arguments

The executeProjectSet task provides the following arguments:

Argument Description Required
workspaceDirectory Absolute path of the workspace directory Either 'workspaceDirectory' or 'workspaceId' has to be specified
workspaceId The identifier of a defined workspace (see <workspaceDefinition>) Either 'workspaceDirectory' or 'workspaceId' has to be specified
projectNames comma separated list of project names either 'projectNames' or 'teamProjectSet' has to be specified
teamProjectSet name of an eclipse team project set file either 'projectNames' or 'teamProjectSet' has to be specified
pathSeparator The system-dependent path-separator character. This character is used to separate filenames in a sequence of files. no (default: On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';')
dirSeparator The system-dependent default name-separator character. no (default: On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\')
allWorkspaceProjects If set to true all projects in the workspace will be added to the set of projects. Otherwise only those projects are taken into account that are defined either in a team project set file or in the projectNames attribute. either 'allProject' or 'teamProjectSet' or 'projectNames' has to be specified
resolveBuildOrder If set to true the build order of the specified projects will be resolved. no (default: true)
projectReferenceTypes Projects can have references of different types. With the projectReferenceTypes you can define, which kind of reference should be taken into account while computing the build order. Currently the following values are possible: jdt, platform. no (default: all available reference types)
prefix the prefix for all scoped properties and references no (default: executeProjectSet)

Nested Elements

To iterate over the projects defined in the executeProjectSet task, you can define one or more nested elements. Those elements can contain several task calls, similar to a target element. The following elements are defined:

  • forEachProject: executed for each project

Scoped properties

Several properties and references are "passed in", so you can access them within the forEachProject element. The following scoped properties are available:

Property Description
<prefix>.project.name The name of the project
<prefix>.project.directory Absolute path of the project directory
<prefix>.<project nature name> true (this property is set for each project nature the project contains)

Scoped references

The following scoped references are available:

Reference Description
<prefix>.project.directory.path The project directory as an ant path

Example usage

Working with project set files

The following example shows how to iterate over a project set defined by a team project set file (projectSet.psf):

<ant4eclipse:executeProjectSet workspace="${workspace}"
		               teamprojectset="projectSet.psf" >
 
  <ant4eclipse:forEachProject>
    <echo>${executeProjectSet.project.name}</echo>
  </ant4eclipse:forEachProject>
 
</ant4eclipse:executeProjectSet>

The following example only iterates over the java projects of the team project set:

<ant4eclipse:executeProjectSet workspaceDirectory="${workspace}"
		               teamprojectset="projectSet.psf" >
 
  <ant4eclipse:forEachProject filter="(executeProjectSet.org.eclipse.jdt.core.javanature=*)" >
    <echo>${executeProjectSet.project.name}</echo>
  </ant4eclipse:forEachProject>
 
</ant4eclipse:executeProjectSet>

Defining a project set by a list of project names

The following example shows how to iterate over a project set defined by all projects defined in the workspace:

<ant4eclipse:executeProjectSet workspaceDirectory="${workspace}"
		               projectNames="simpleProject, secondProject" >
 
  <ant4eclipse:forEachProject>
    <echo>${executeProjectSet.project.name}</echo>
  </ant4eclipse:forEachProject>
 
</ant4eclipse:executeProjectSet>

Choosing all projects within a workspace

The following example shows how to iterate over a project set defined by all projects defined in the workspace.

<ant4eclipse:executeProjectSet workspaceDirectory="${workspace}"
		               allWorkspaceProjects="true" >
 
  <ant4eclipse:forEachProject>
    <echo>${executeProjectSet.project.name}</echo>
  </ant4eclipse:forEachProject>
 
</ant4eclipse:executeProjectSet>