|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
net.spy.ant.BuildInfoTask
public class BuildInfoTask
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(java.lang.String to)
Set the path to the build properties. |
void |
setChangelog(java.lang.String to)
Set the path to the change log. |
void |
setDestdir(java.lang.String to)
Set the destination directory (top level generated code directory). |
void |
setPackage(java.lang.String to)
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 |
|---|
public BuildInfoTask()
| Method Detail |
|---|
public void setPackage(java.lang.String to)
public void setBuildprops(java.lang.String to)
public void setChangelog(java.lang.String to)
public void setDestdir(java.lang.String to)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||