Checking Out Code from CVS
Problem
You want your Ant buildfile to check out code from CVS before compiling.
Solution
Use Ant’s cvs
task.
Discussion
You can use the cvs
Ant task to execute any CVS
command. In order for this to work, you must have installed the
cvs
executable on your system path. If Ant does
not find cvs
, it issues an error and the build
fails.
By default, the cvs
task executes a
checkout
command. Here is the syntax to checkout
the cookbook module from CVS:
<cvs cvsroot="${cvsroot}" package="cookbook"/>
You can also execute any other CVS command, such as
update
as shown here:
<cvs command="update -dP" cvsroot="${cvsroot}" dest="cookbook"/>
This tells CVS to update the most recent files in the
cookbook
directory, creating missing directories
and pruning empty directories.
Tip
If cvsroot
is not specified, the already-defined
CVS root from the checked out project is used.
See Also
See the CVS documentation for information about all of the CVS commands.
Get Java Extreme Programming Cookbook 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.