<ccapply> Task
Interface between Ant and the ClearCase "cleartool" command; supports nested elements, as in the Ant <apply> task.

This task is a simple interface to the "cleartool" command. It is basically a wrapper around the Ant <apply> task with the executable name hard coded to "cleartool". The power of the <apply> task is that it supports nested elements (such as filesets or filelists) and regular expression "mappers". You can therefore use this command to iterate a ClearCase command over a number of ClearCase elements (see the examples below for more information).

Attribute Description Type Requirement
cleartoolCmd Sets the name of the cleartool command.
Default is cleartool.
String Optional
cleartoolPath Sets the path to the cleartool command.
Defaults to empty (and uses PATH entry)
Parameters as nested elements
See the Ant <apply> task for supported parameters.

The following snippet will run "cleartool describe -short" on the set of jar files in the src directory:

       <project name="test" default="main" 
            <property name="dir.src" value="src"/>
            <target name="main">
		    <arg value="describe"/>
		    <arg value="-short"/>
		    <fileset dir="${dir.src}" casesensitive="yes">
			<include name="**/*.java"/>
			<exclude name="**/*Test*"/>

The following snippet will "stage" the set of jar files in the dist directory to a release directory; note the use of "<srcfile/>" and "<targetfile/>" elements that can be used to construct a command line for <ccapply>, as well as the "<globmapper>" which turns the source jar into the full path of its destination:

       <property name="dir.dist" value="dist"/>
       <property name="dir.rel" value="X:\ReleaseVOB"/>
       <ca:ccapply relative="true" force="true">
            <arg value="checkin"/>
            <arg line="-nc -rm -from"/>
                <fileset dir="${dir.dist}" casesensitive="yes">
		    <include name="**/*.jar"/>
            <globmapper from="*" to="${dir.rel}*"/>

Copyright 2000-2006, Kevin A. Lee; Portions Apache Software Foundation