by
Version 1.0 - 2001/04/04
Controls a build process by terminating a build if no modifications have been made. This element must include subelements designed to provide a list of modifications, such as CVSElement.
To use this task in an Ant build script the following line will need to be included so that Ant will know where to find the task:
<taskdef name="modificationset" classname="net.sourceforge.cruisecontrol.ModificationSet" />
NOTE: The property modificationset.file
is required by
ModificationSet. The value provided will be used to determine the filename for
writing modifications. See examples below.
Attribute | Description | Required |
lastbuild | The time the last build occured. When used in conjuction with
the MasterBuild class this should be set to the property ${lastGoodBuildTime} |
Yes |
quietperiod | The number of seconds that must expire after the last repository change before a build will commence. Set this value to allow developers enough time to commit all their changes to the repository. This stops a build from commencing while a developer is in the middle of their commit process. | Yes |
dateformat | Date formatting pattern which conforms to those recognized by
java.text.SimpleDateFormat .
If none is provided, then the default date format will be used,
MM-dd-yyyy HH:mm:ss . Dates will be displayed in the timezone
of the current Locale. |
No |
Returns a list of modifications found in the repository between two dates. This element is meant to be used in conjuction with a ModificationSet to control a build process.
Attribute | Description | Required |
cvsroot | The CVSROOT required to communicate with the CVS repository. | Yes |
localworkingcopy | This directory will be used to determine from which point in the repository to recursively obtain the log history. | Yes |
Returns a list of modifications found in the repository between two dates. This element is meant to be used in conjuction with a ModificationSet to control a build process. The two property attributes are meant to provide the rest of the ant script with a means to conditionally build targets based on what was actually modified. See the examples below for more detail. I've found that it's quicker to log if a delete has occurred within vsselement, clean out all the source using Ant, and reget all the source rather than using sourcesafe to try to sync itself up with the local drive. That's the rationale behind having the propertyondelete attribute.
Attribute | Description | Required |
ssdir | The sourcesafe directory that you would like to recursively scan for modifications. | Yes |
login | login,password for sourcesafe. | Yes |
property | Set the given property to "true" if any modifications have occurred within this sourcesafe folder or any child folders recursively. | No |
propertyondelete | Set the given property to "true" if any deletes have occurred within this sourcesafe folder or any child folders recursively. | No |
Returns a list of modifications found in the repository between two dates. This element is meant to be used in conjuction with a ModificationSet to control a build process. NOTE: this class is not currently distributed with cruisecontrol.jar as it requires a proprietary 3rd party library.
Attribute | Description | Required |
folder | The StarTeam folder to recursively scan for modifications. | Yes |
starteamurl | The url to the StarTeam server | Yes |
username | The username to connect as. | Yes |
password | The password to connect as. | Yes |
<target name="modificationset"> <property name="modificationset.file" value="logs\modificationset.xml" /> <modificationset lastbuild="${lastGoodBuildTime}" quietperiod="30" dateformat="yyyy-MMM-dd HH:mm:ss"> <cvselement cvsroot=":pserver:anoncvs@jakarta.apache.org:/home/cvspublic" localworkingcopy="src\mymodule"/> </modificationset> </target>
<target name="modificationset"> <property name="modificationset.file" value="logs\modificationset.xml" /> <modificationset lastbuild="${lastGoodBuildTime}" quietperiod="30" dateformat="yyyy-MMM-dd HH:mm:ss"> <vsselement ssdir="$/Project/src" login="mylogin,mypassword" property="modificationset.src" propertyondelete="modificationset.src.delete"/> <vsselement ssdir="$/Project/jsp" login="mylogin,mypassword" property="modificationset.jsp" propertyondelete="modificationset.jsp.delete"/> <vsselement ssdir="$/Project/lib" login="mylogin,mypassword" property="modificationset.lib" propertyondelete="modificationset.lib.delete"/> </modificationset> </target>This example will recursively scan 3 different folders in sourcesafe, and conditionally set the properties named in each element. Thus, i can call a "clean" target for each of these folders and, using the "depends" attribute, determine whether i need to clean. The same applies for a target to get the latest source. If no modifications have occurred within my src directory, but we've modified a jsp file, we really don't need to compile all our source again, just repackage our distributable.