Check out from CVS : CVS « Ant « Java

Check out from CVS

<?xml version="1.0"?>
<project name="Java XP Cookbook" default="build" basedir=".">

  <target name="prepare">
    <!-- convert the CVS repository directory into
         a fully-qualitied Windows directory -->
    <pathconvert targetos="windows" property="cvsrepository.path">
         <pathelement location="repository"/>
    <!-- store the CVS root in a property -->
    <property name="cvsroot" value=":local:${cvsrepository.path}"/>

    <!-- determine if the files have been checked out -->
    <available file="cookbook" type="dir" property="already.checked.out"/>

  <target name="clean"
          description="Remove the entire cookbook directory.">
    <delete dir="cookbook"/>

  <target name="cvscheckout" depends="prepare" unless="already.checked.out">
    <cvs cvsroot="${cvsroot}"

  <target name="cvsupdate" depends="prepare" if="already.checked.out">
    <cvs command="update -dP"

  <target name="build" depends="cvscheckout,cvsupdate">
    <ant dir="cookbook" target="all" inheritAll="false"/>


       1 k)

Related examples in the same category

1.Check out source code from cvs
2.CVS update