org.clapper.util.ant
Class MakeBuildInfoTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.clapper.util.ant.MakeBuildInfoTask

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

Ant task to create a build info properties file. A build info properties file contains a series of properties containing information about the build time, build environment, etc. The file is actually created by the static BuildInfo.makeBuildInfoBundle() method. This Ant task is simply a thin wrapper around that method.

The Ant build file logic necessary to define and invoke this task is:

 <taskdef name="make_build_info" 
          classname="org.clapper.util.ant.MakeBuildInfoTask"
          classpath="${build}"/>
 <make_build_info file="${build}/org/example/BuildInfoBundle.properties
                  antversion="${ant.version}"
                  compiler="${build.compiler}"
 />
 

Version:
$Revision: 6735 $
Author:
Copyright © 2004-2007 Brian M. Clapper

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
MakeBuildInfoTask()
          Default constructor
 
Method Summary
 void execute()
          Execute the Ant task, retrieving the host name and storing it in the property.
 void setAntversion(java.lang.String s)
          Called by Ant to set the "antversion" attribute.
 void setCompiler(java.lang.String s)
          Called by Ant to set the "compiler" attribute.
 void setFile(java.io.File file)
          Called by Ant to set the "file" attribute.
 
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

MakeBuildInfoTask

public MakeBuildInfoTask()
Default constructor

Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Execute the Ant task, retrieving the host name and storing it in the property.

Overrides:
execute in class org.apache.tools.ant.Task
Throws:
org.apache.tools.ant.BuildException - on error

setFile

public void setFile(java.io.File file)
Called by Ant to set the "file" attribute.

Parameters:
file - the file

setAntversion

public void setAntversion(java.lang.String s)
Called by Ant to set the "antversion" attribute.

Parameters:
s - the version string

setCompiler

public void setCompiler(java.lang.String s)
Called by Ant to set the "compiler" attribute.

Parameters:
s - the compiler string


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.