org.apache.cactus.ant
Class ChangeLogTask

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.cactus.ant.ChangeLogTask
All Implemented Interfaces:
org.apache.tools.ant.taskdefs.ExecuteStreamHandler

public class ChangeLogTask
extends org.apache.tools.ant.Task
implements org.apache.tools.ant.taskdefs.ExecuteStreamHandler

A CVS log task that extract information from the execution of the 'cvs log' command and put them in a generated output XML file. Note: I have rewritten this task based on the ChangeLog cvslog task from the Jakarta Alexandria project (initially written by Jeff Martin)

Version:
$Id: ChangeLogTask.java,v 1.5 2002/04/21 21:13:40 vmassol Exp $
Author:
Jeff Martin, Vincent Massol

Constructor Summary
ChangeLogTask()
           
 
Method Summary
 void addFileset(org.apache.tools.ant.types.FileSet theSet)
          Adds a set of files (nested fileset attribute).
 void execute()
          Execute task
 void setDate(java.lang.String theThresholdDate)
          Set the threshold cvs log date.
 void setDebug(java.io.File theDebugFile)
          Set the debug file.
 void setElapsed(java.lang.Long theElapsedDays)
          Set the threshold cvs log date by calculating it : "today - elapsed".
 void setExecutable(java.lang.String theExecutable)
          Sets the CVS client executable to use to perform "cvs log".
 void setOutput(java.io.File theOutputFile)
          Set the output file for the log.
 void setProcessErrorStream(java.io.InputStream theIs)
          Set the error stream for reading from CVS log.
 void setProcessInputStream(java.io.OutputStream theOs)
          Set the input stream for the CVS process.
 void setProcessOutputStream(java.io.InputStream theIs)
          Set the input stream used to read from CVS log
 void setTestURL(java.lang.String theURLString)
          Set the test URL to check if internet access is on.
 void setUsers(java.io.File theUserConfigFileName)
          Set the properties file name containing the matching list of (user id, user display name).
 void setWork(java.io.File theWorkDir)
          Set the CVS working directory where the cvs log operation will be performed.
 void start()
          Start reading from the cvs log stream.
 void stop()
          Stop handling of the streams (i.e.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, init, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeLogTask

public ChangeLogTask()
Method Detail

setUsers

public void setUsers(java.io.File theUserConfigFileName)
Set the properties file name containing the matching list of (user id, user display name). This method is automatically called by the Ant runtime engine when the users attribute is encountered in the Ant XML build file. This attribute is optional.
Parameters:
theUserConfigFileName - the properties file name relative to the Ant project base directory (basedir attribute in build file).

setWork

public void setWork(java.io.File theWorkDir)
Set the CVS working directory where the cvs log operation will be performed. This method is automatically called by the Ant runtime engine when the work attribute is encountered in the Ant XML build file. This attribute is mandatory.
Parameters:
theWorkDir - the CVS working directory relative to the Ant project base directory (basedir attribute in build file).

setOutput

public void setOutput(java.io.File theOutputFile)
Set the output file for the log. This method is automatically called by the Ant runtime engine when the output attribute is encountered in the Ant XML build file. This attribute is mandatory.
Parameters:
theOutputFile - the XML output file relative to the Ant project base directory (i.e. basedir attrifbute in build file).

setExecutable

public void setExecutable(java.lang.String theExecutable)
Sets the CVS client executable to use to perform "cvs log".
Parameters:
theExecutable - the executable to use

setDate

public void setDate(java.lang.String theThresholdDate)
Set the threshold cvs log date. This method is automatically called by the Ant runtime engine when the date attribute is encountered in the Ant XML build file. This attribute is optional. The format is "yyyy/MM/dd".
Parameters:
theThresholdDate - the threshold date before which cvs log are ignored.

setElapsed

public void setElapsed(java.lang.Long theElapsedDays)
Set the threshold cvs log date by calculating it : "today - elapsed". This method is automatically called by the Ant runtime engine when the elapsed attribute is encountered in the Ant XML build file. This attribute is optional. The elasped time must be expressed in days.
Parameters:
theElapsedDays - the elapsed time from now in days. All cvs logs that are this old will be shown.

addFileset

public void addFileset(org.apache.tools.ant.types.FileSet theSet)
Adds a set of files (nested fileset attribute). This method is automatically called by the Ant runtime engine when the fileset nested tag is encountered in the Ant XML build file. This attribute is optional.
Parameters:
theSet - the fileset that contains the list of files for which cvs logs will be checked.

setTestURL

public void setTestURL(java.lang.String theURLString)
Set the test URL to check if internet access is on. This method is automatically called by the Ant runtime engine when the testURL attribute is encountered in the Ant XML build file. This attribute is optional.
Parameters:
theURLString - the test URL string.

setDebug

public void setDebug(java.io.File theDebugFile)
              throws java.io.FileNotFoundException,
                     java.io.UnsupportedEncodingException,
                     java.io.IOException
Set the debug file. This is optional and debug will be turned on only when this attribute is set. All output from the cvs log command will be dumped to this debug file.
Parameters:
theDebugFile - the name of the debug file to use.
Throws:
java.io.IOException - for backward compatibility with JDK 1.2.2 (not needed for JDK 1.3+)

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute task
Overrides:
execute in class org.apache.tools.ant.Task

setProcessInputStream

public void setProcessInputStream(java.io.OutputStream theOs)
                           throws java.io.IOException
Set the input stream for the CVS process. As CVS requires no input, this is not used.
Specified by:
setProcessInputStream in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
Parameters:
theOs - the output stream to write to the standard input stream of the subprocess (i.e. the CVS process)

setProcessErrorStream

public void setProcessErrorStream(java.io.InputStream theIs)
                           throws java.io.IOException
Set the error stream for reading from CVS log. Not used in the current version (should be handled in future versions).
Specified by:
setProcessErrorStream in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
Parameters:
theIs - the input stream to read from the error stream from the subprocess (i.e. the CVS process)

setProcessOutputStream

public void setProcessOutputStream(java.io.InputStream theIs)
                            throws java.io.IOException
Set the input stream used to read from CVS log
Specified by:
setProcessOutputStream in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler
Parameters:
theIs - the input stream to read from the output stream of the subprocess (i.e. the CVS process)

stop

public void stop()
Stop handling of the streams (i.e. the cvs process).
Specified by:
stop in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler

start

public void start()
           throws java.io.IOException
Start reading from the cvs log stream.
Specified by:
start in interface org.apache.tools.ant.taskdefs.ExecuteStreamHandler


Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.