Chapter 6. Getting Source Code from CVS Repositories

Up to this point, you've been working solo with Ant, butas with any major build toolAnt can be used in team environments. There's a lot of support built in for the Concurrent Version System (CVS) in Ant, and this chapter is all about making code sharing in teams with CVS happen.

Source Control and Ant

When you work in teams, you have to coordinate your efforts. That means discussing and planning, but even with the best of intentions, you can still end up with unintentional conflicts. You may have made some brilliant changes to the code, only to find them wiped out by mistake when another programmer uploads his own version of the same file.

Source control helps prevent these problems by controlling access to code and by maintaining a history of the changes made so things aren't destroyed unintentionally. Storing a history of your code is powerful; you can compare a new (buggy) file against an older one, and you can revert to a previous version in case things have gone bad.

Ant has several source control tasks, shown in Table 6-1.

Table 6-1. Source control tasks

Task name

Description

clearcase

Tasks for ClearCase cleartool checkin, checkout, uncheckout, update, lock, unlock, mklbtype, rmtype, mklabel, mkattr, mkdir, mkelem, and mkbl commands

Continuus/Synergy tasks

Tasks for Continuus ccmcheckin, ccmcheckout, ccmcheckintask, ccmreconfigure, and ccmcreateTask commands

cvs

Specifies how to work with packages and modules retrieved ...

Get Ant: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.