Skip to Content

<svnGetProjectSet>

Scope: All Project Types

Description

Use the svnGetProjectSet task to automatically check out all projects defined in a subversion-based team project set. The svnGetProjectSet requires the name of a Team Project Set file and a destination directory into which the projects will be checked out. Furthermore you may need to specify a username and a password for SVN, that depends on your repository. Ant4eclipse will check out all projects listed in the file in the version / from the branch that is speciified in the file.

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
projectset Project Set File that defines the projects to be
checked out
yes
username User for SVN-connection no
password Password for SVN-connection no
command Determine whether the project set should be checked
out, updated or exported
yes (one of: checkout, export or update)
javahl Determines whether the svn-Task should try to use the (native) javahl library no (defaults to 'true')
javasvn Determines whether the svn-Task should try to use the pure-java SVN binding (svnkit) no (defaults to 'true')
dateFormatter formatter definition used to format/parse dates (e.g. when revision is specified as date). no
dateTimeZone time zone used to format/parse dates (e.g. when revision is specified as date). no

The svnGetProjectSet-Tasks takes a command argument that detemines how a project will be received from the CVS repository:

  • checkout: Checks out the complete projects from SVN (svn checkout)
  • update: Updates the projects: receive/remove changed files only (svn checkout)
  • export: Like checkout, but removes the .SVN directories, so the checked out projects have no connection to SVN anymore (svn export)

Setup

  1. In order to use the svnGetProjectSet task you must have svn-ant installed, which can be obtained from http://subclipse.tigris.org/svnant.html. Ant4Eclipse is built and tested against the 1.1.0-RC2 version of svn-ant.
  2. You'll need to have the jar files shipped with svn-ant in one of your Ant lib-directories (i.e. a directory you'll point ant with "-lib" to). Note: You can not use the classpath elements in the taskdef (see below) for svn-ant since that results in a ClassCastException due to Classloader mismatch.
  3. You'll need to add a taskdef element to your build file to make Ant (and Ant4Eclipse) aware of the svn-Task (that is used internally by Ant4Eclipse): &lt;taskdef resource="org/tigris/subversion/svnant/svnantlib.xml"/&gt;

Providers

The svnGetProjectSetTask has been tested with PSF-files exported by the Subclipse and the Subversive plugins. If you'll discover any problems with a PSF file please send us the PSF file and information which plugin you used to export it (including the plugin's version!)

Examples

The following example shows how to checkout projects defined in a team project set. Note that it is required to have ant4eclipse.jar as well as the jars from the svn-ant-Project in your classpath (see "Setup" above):

<project name="..." default="...">
 
  <!-- define Ant4Eclipse tasks -->
  <taskdef uri="antlib:org.ant4eclipse" resource="org/ant4eclipse/antlib.xml" />
 
  <!-- define svnant tasks -->
  <taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" />
 
  <target name="checkout-psf">
    <!-- Check out the contents of "myProjectSet.psf" into the directory "${workspace.dir}" -->
    <ant4eclipse:svnGetProjectSet username="myCvsUserId"
                                  password="myCvsPassword"
                                  command="checkout"
                                  projectSet="myProjectSet.psf"
                                  workspace="${workspace.dir}">
 
  </target>
</project>