ChangeLogTask (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.cvslib, class: ChangeLogTask

# Class ChangeLogTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.AbstractCvsTask
org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask

All Implemented Interfaces:
  `Cloneable`

public class ChangeLogTask extends AbstractCvsTask
Examines the output of cvs log and group related changes together. It produces an XML output representing the list of changes.

    <!-- Root element -->
    <!ELEMENT changelog (entry+)>
    <!-- CVS Entry -->
    <!ELEMENT entry (date,author,file+,msg)>
    <!-- Date of cvs entry -->
    <!ELEMENT date (#PCDATA)>
    <!-- Author of change -->
    <!ELEMENT author (#PCDATA)>
    <!-- List of files affected -->
    <!ELEMENT msg (#PCDATA)>
    <!-- File changed -->
    <!ELEMENT file (name,revision,prevrevision?)>
    <!-- Name of the file -->
    <!ELEMENT name (#PCDATA)>
    <!-- Revision number -->
    <!ELEMENT revision (#PCDATA)>
    <!-- Previous revision number -->
    <!ELEMENT prevrevision (#PCDATA)>

Since:
  Ant 1.5

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class AbstractCvsTask

  `AbstractCvsTask.Module`
  Modifier and Type
  Class
  Description
  `static final class`
  `AbstractCvsTask.Module`

- ## Field Summary

  ### Fields inherited from class AbstractCvsTask

  `DEFAULT_COMPRESSION_LEVEL`
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_COMPRESSION_LEVEL`
  Default compression level to use, if compression is enabled via setCompression(true).

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ChangeLogTask()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addFileset(FileSet fileSet)`
  Adds a set of files about which cvs logs will be generated.
  `void`
  `addUser(CvsUser user)`
  Add a user to list changelog knows about.
  `void`
  `execute()`
  Execute task
  `void`
  `setDaysinpast(int days)`
  Set the number of days worth of log entries to process.
  `void`
  `setDestfile(File destFile)`
  Set the output file for the log.
  `void`
  `setDir(File inputDir)`
  Set the base dir for cvs.
  `void`
  `setEnd(Date endDate)`
  Set the date at which the changelog should stop.
  `void`
  `setEndTag(String end)`
  Set the tag at which the changelog should stop.
  `void`
  `setRemote(boolean remote)`
  Whether to use rlog against a remote repository instead of log in a working copy's directory.
  `void`
  `setStart(Date start)`
  Set the date at which the changelog should start.
  `void`
  `setStartTag(String start)`
  Set the tag at which the changelog should start.
  `void`
  `setUsersfile(File usersFile)`
  Set a lookup list of user names & addresses

  ### Methods inherited from class AbstractCvsTask

  `addCommandArgument, addCommandArgument, addConfiguredCommandline, addConfiguredCommandline, addModule, configureCommandline, getCommand, getCvsRoot, getCvsRsh, getDest, getErrorStream, getExecuteStreamHandler, getModules, getOutputStream, getPackage, getPassFile, getPort, getTag, removeCommandline, runCommand, setAppend, setCommand, setCompression, setCompressionLevel, setCvsRoot, setCvsRsh, setDate, setDest, setError, setErrorStream, setExecuteStreamHandler, setFailOnError, setNoexec, setOutput, setOutputStream, setPackage, setPassfile, setPort, setQuiet, setReallyquiet, setTag`
  Modifier and Type
  Method
  Description
  `void`
  `addCommandArgument(String arg)`
  This needs to be public to allow configuration of commands externally.
  `void`
  `addCommandArgument(Commandline c, String arg)`
  This method adds a command line argument to an external command.
  `void`
  `addConfiguredCommandline(Commandline c)`
  Adds direct command-line to execute.
  `void`
  `addConfiguredCommandline(Commandline c, boolean insertAtStart)`
  Configures and adds the given Commandline.
  `void`
  `addModule(AbstractCvsTask.Module m)`
  add a named module/package.
  `protected void`
  `configureCommandline(Commandline c)`
  Configure a commandline element for things like cvsRoot, quiet, etc.
  `String`
  `getCommand()`
  accessor to a command line as string This should be deprecated AntoineLL July 23d 2003
  `String`
  `getCvsRoot()`
  access the CVSROOT variable
  `String`
  `getCvsRsh()`
  access the CVS_RSH variable
  `File`
  `getDest()`
  get the file where the checked out files should be placed
  `protected OutputStream`
  `getErrorStream()`
  access the stream to which the stderr from cvs should go if this stream has already been set, it will be returned if the stream has not yet been set, if the attribute error has been set, the output stream will go to the file denoted by the error attribute otherwise the stderr output will go to ant's logging system
  `protected ExecuteStreamHandler`
  `getExecuteStreamHandler()`
  find the handler and instantiate it if it does not exist yet
  `protected List<AbstractCvsTask.Module>`
  `getModules()`
  `protected OutputStream`
  `getOutputStream()`
  access the stream to which the stdout from cvs should go if this stream has already been set, it will be returned if the stream has not yet been set, if the attribute output has been set, the output stream will go to the output file otherwise the output will go to ant's logging system
  `String`
  `getPackage()`
  access the package or module to operate upon
  `File`
  `getPassFile()`
  find the password file
  `int`
  `getPort()`
  access the port of CVS
  `String`
  `getTag()`
  tag or branch
  `protected void`
  `removeCommandline(Commandline c)`
  remove a particular command from a vector of command lines
  `protected void`
  `runCommand(Commandline toExecute)`
  Sets up the environment for toExecute and then runs it.
  `void`
  `setAppend(boolean value)`
  Whether to append output/error when redirecting to a file.
  `void`
  `setCommand(String c)`
  The CVS command to execute.
  `void`
  `setCompression(boolean usecomp)`
  If true, this is the same as compressionlevel="3".
  `void`
  `setCompressionLevel(int level)`
  If set to a value 1-9 it adds -zN to the cvs command line, else it disables compression.
  `void`
  `setCvsRoot(String root)`
  The CVSROOT variable.
  `void`
  `setCvsRsh(String rsh)`
  The CVS_RSH variable.
  `void`
  `setDate(String p)`
  Use the most recent revision no later than the given date.
  `void`
  `setDest(File dest)`
  The directory where the checked out files should be placed.
  `void`
  `setError(File error)`
  The file to direct standard error from the command.
  `protected void`
  `setErrorStream(OutputStream errorStream)`
  sets a stream to which the stderr from the cvs exe should go
  `void`
  `setExecuteStreamHandler(ExecuteStreamHandler handler)`
  sets the handler
  `void`
  `setFailOnError(boolean failOnError)`
  Stop the build process if the command exits with a return code other than 0.
  `void`
  `setNoexec(boolean ne)`
  If true, report only and don't change any files.
  `void`
  `setOutput(File output)`
  The file to direct standard output from the command.
  `protected void`
  `setOutputStream(OutputStream outputStream)`
  sets a stream to which the output from the cvs executable should be sent
  `void`
  `setPackage(String p)`
  The package/module to operate upon.
  `void`
  `setPassfile(File passFile)`
  Password file to read passwords from.
  `void`
  `setPort(int port)`
  Port used by CVS to communicate with the server.
  `void`
  `setQuiet(boolean q)`
  If true, suppress informational messages.
  `void`
  `setReallyquiet(boolean q)`
  If true, suppress all messages.
  `void`
  `setTag(String p)`
  The tag of the package/module to operate upon.

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ChangeLogTask

    public ChangeLogTask()

- ## Method Details

  - ### setDir

    public void setDir(File inputDir)
    Set the base dir for cvs.
    Parameters:
      `inputDir` - The new dir value

  - ### setDestfile

    public void setDestfile(File destFile)
    Set the output file for the log.
    Parameters:
      `destFile` - The new destfile value

  - ### setUsersfile

    public void setUsersfile(File usersFile)
    Set a lookup list of user names & addresses
    Parameters:
      `usersFile` - The file containing the users info.

  - ### addUser

    public void addUser(CvsUser user)
    Add a user to list changelog knows about.
    Parameters:
      `user` - the user

  - ### setStart

    public void setStart(Date start)
    Set the date at which the changelog should start.
    Parameters:
      `start` - The date at which the changelog should start.

  - ### setEnd

    public void setEnd(Date endDate)
    Set the date at which the changelog should stop.
    Parameters:
      `endDate` - The date at which the changelog should stop.

  - ### setDaysinpast

    public void setDaysinpast(int days)
    Set the number of days worth of log entries to process.
    Parameters:
      `days` - the number of days of log to process.

  - ### setRemote

    public void setRemote(boolean remote)
    Whether to use rlog against a remote repository instead of log in a working copy's directory.
    Parameters:
      `remote` - boolean
    Since:
      Ant 1.8.0

  - ### setStartTag

    public void setStartTag(String start)
    Set the tag at which the changelog should start.
    Parameters:
      `start` - The date at which the changelog should start.

  - ### setEndTag

    public void setEndTag(String end)
    Set the tag at which the changelog should stop.
    Parameters:
      `end` - The date at which the changelog should stop.

  - ### addFileset

    public void addFileset(FileSet fileSet)
    Adds a set of files about which cvs logs will be generated.
    Parameters:
      `fileSet` - a set of files about which cvs logs will be generated.

  - ### execute

    public void execute() throws BuildException
    Execute task
    Overrides:
      `execute` in class `AbstractCvsTask`
    Throws:
      `BuildException` - if something goes wrong executing the cvs command