Section 6.5. Creating Change Logs


6.5. Creating Change Logs

This task creates an XML-formatted report file of the change logs in a CVS repository. If you want to track what's been happening with a module, this is the way to do it. For example, take a look at the build file in Example 6-5, which creates a change log, changelog.xml, for the GreetingApp module:

Example 6-5. Getting a CVS change log (ch06/changelog/build.xml)
<?xml version="1.0"?> <project default="main" basedir=".">     <property name="cvs.dir" value="project" />     <target name="main" >         <cvspass cvsroot=":pserver:steven@STEVE:/home/steven/repository"              password="opensesame" />         <cvschangelog dir="${cvs.dir}/GreetingApp" destfile="changelog.xml" />     </target> </project>

Here's the resulting change log, changelog.xml:

<?xml version="1.0" encoding="UTF-8"?> <changelog>     <entry>         <date>2005-02-24</date>         <time>16:18</time>         <author><![CDATA[steven]]></author>         <file>             <name>org/antbook/ch06/GreetingClass.java</name>             <revision>1.1</revision>         </file>         <msg><![CDATA[The Greeting App]]></msg>     </entry>     <entry>         <date>2005-06-22</date>         <time>16:25</time>         <author><![CDATA[steven]]></author>         <file>             <name>org/antbook/ch06/GreetingClass.java</name>             <revision>1.3</revision>             <prevrevision>1.2</prevrevision>         </file>         <msg><![CDATA[*** empty log message ***]]></msg>     </entry>     <entry>         <date>2005-02-25</date>         <time>16:24</time>         <author><![CDATA[steven]]></author>         <file>             <name>.classpath</name>             <revision>1.1</revision>         </file>         <file>             <name>.project</name>             <revision>1.1</revision>         </file>         <msg><![CDATA[The Greeting App]]></msg>     </entry>     <entry>         <date>2005-02-25</date>         <time>16:34</time>         <author><![CDATA[steven]]></author>         <file>             <name>org/antbook/ch06/GreetingClass.java</name>             <revision>1.2</revision>             <prevrevision>1.1</prevrevision>         </file>         <msg><![CDATA[*** empty log message ***]]></msg>     </entry>     <entry>         <date>2005-06-22</date>         <time>16:27</time>         <author><![CDATA[steven]]></author>         <file>             <name>org/antbook/ch06/GreetingClass.java</name>             <revision>1.4</revision>             <prevrevision>1.3</prevrevision>         </file>         <msg><![CDATA[OK]]></msg>     </entry>     <entry>         <date>2005-06-22</date>         <time>16:29</time>         <author><![CDATA[steven]]></author>         <file>             <name>org/antbook/ch06/GreetingClass.java</name>             <revision>1.5</revision>             <prevrevision>1.4</prevrevision>         </file>         <msg><![CDATA[New Version]]></msg>     </entry> </changelog>

The attributes for this task appear in Table 6-6.

Table 6-6. The cvschangelog task's attributes

Attribute

Description

Required

Default

cvsroot

Specifies the

CVSROOT

variable you want to use

No

 

cvsrsh

Specifies the

CVS_RSH

variable you want to use

No

 

daysinpast

Specifies for how many days in the past you want change log information

No

 

destfile

Specifies the file in which you want the change log report written

Yes

 

dir

Specifies the directory from which to run the CVS log command

No

${basedir}

end

Specifies the latest date for which you want to include change logs

No

 

failonerror

Specifies that you want the task to fail if it encounters an error

No

false

package

Specifies the module you want to check out

No

 

passfile

Specifies the password file you want the task to read passwords from

No

~/.cvspass

port

Specifies the port the task should use to communicate with the CVS server

No

port 2401

start

Specifies the earliest date for which you want to include change logs

No

 

tag

Lets you access change logs by tag

No

 

usersfile

Specifies a property file holding name/value pairs connecting user IDs and names, allowing the task to report names inctead of IDs

No

 


The nested user element allows you to specify a mapping between a user ID (as it appears to the CVS server) and a name to include in the formatted report. The attributes of the user element appear in Table 6-7.

Table 6-7. The user element's attributes

Attribute

Description

Required

Default

displayname

Specifies the name you want used in the CVS change log report

Yes

 

userid

Specifies the user ID of the person as far as the CVS server is concerned

Yes

 




    Ant. The Definitive Guide
    Ant: The Definitive Guide, 2nd Edition
    ISBN: 0596006098
    EAN: 2147483647
    Year: 2003
    Pages: 115
    Authors: Steve Holzner

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net