org.apache.tools.ant.taskdefsClass BuildNumber
- java.lang.Object
- org.apache.tools.ant.ProjectComponent
- org.apache.tools.ant.Task
- org.apache.tools.ant.taskdefs.BuildNumber
- All Implemented Interfaces:
- java.lang.Cloneable
public class BuildNumber extends TaskRead, increment, and write a build number in a file It will first attempt to read a build number from a file, then set the property "build.number" to the value that was read in (or 0 if no such value). Then it will increment the build number by one and write it back out into the file.
- Since:
- Ant 1.5
Field Summary
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
Constructor Summary
Constructors Constructor and Description BuildNumber()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
execute()
Run task.void
setFile(java.io.File file)
The file in which the build number is stored.
Methods inherited from class org.apache.tools.ant.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
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
Method Detail
setFile
public void setFile(java.io.File file)The file in which the build number is stored. Defaults to "build.number" if not specified.
- Parameters:
file
- the file in which build number is stored.
execute
public void execute() throws BuildExceptionRun task.
- Overrides:
execute
in classTask
- Throws:
BuildException
- if an error occurs