net.spy.ant
Class BuildInfoTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bynet.spy.ant.BuildInfoTask

public class BuildInfoTask
extends org.apache.tools.ant.Task

Task to build a build info class for a package. An example ant recipe for building a build info class is as follows:

  <propertyfile file="${BUILDDIR}/com/me/build.properties">
    <entry key="java.vendor" value="${java.vendor}"/>
    <entry key="java.version" value="${java.version}"/>
    <entry key="os.name" value="${os.name}"/>
    <entry key="os.version" value="${os.version}"/>
    <entry key="build.date" type="date" value="now"/>
    <entry key="tree.version" value="${tree.version}"/>
  </propertyfile>
  <buildinfo package="com.me" buildprops="com/me/build.properties"
    changelog="com/me/changelog.txt"
    destdir="${GENDIR}"/>
 
In your jar task, you can now do the following:
    <manifest>
      <attribute name="Main-Class" value="com.me.BuildInfo"/>
    </manifest>
 
The changelog is optional, and may be displayed from the jar main with the -c option if it is present.


Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
BuildInfoTask()
          Get an instance of BuildInfoTask.
 
Method Summary
 void execute()
          Create the BuildInfo class.
 void setBuildprops(String buildProps)
          Set the path to the build properties.
 void setChangelog(String changelog)
          Set the path to the change log.
 void setDestdir(String destdir)
          Set the destination directory (top level generated code directory).
 void setPackage(String pkg)
          Set the name of the package that will have the buildinfo file.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildInfoTask

public BuildInfoTask()
Get an instance of BuildInfoTask.

Method Detail

setPackage

public void setPackage(String pkg)
Set the name of the package that will have the buildinfo file.


setBuildprops

public void setBuildprops(String buildProps)
Set the path to the build properties.


setChangelog

public void setChangelog(String changelog)
Set the path to the change log.


setDestdir

public void setDestdir(String destdir)
Set the destination directory (top level generated code directory).


execute

public void execute()
             throws org.apache.tools.ant.BuildException
Create the BuildInfo class.

Throws:
org.apache.tools.ant.BuildException