ch.oscg.jreleaseinfo.anttask
Class JReleaseInfoAntTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by ch.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask
All Implemented Interfaces:
java.lang.Cloneable

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

This Task creates a new java source file with embedded informationen about the current build.

There will be some standard arguments like Version, BuildDate, as well as user defined properties.

The java class will provide final get methods to access these informations.

Version:
$Revision: 1.10 $ ($Date: 2005/08/06 14:13:17 $ / $Author: tcotting $)
Author:
Thomas Cotting, Tangarena Engineering AG, Luzern

Constructor Summary
JReleaseInfoAntTask()
           
 
Method Summary
 void addConfiguredParameter(org.apache.tools.ant.types.Parameter prop)
          Set method for any property using the ant type Parameter.
 void deleteJReleaseInfoFile()
          Utility method to delete the JReleaseInfo file (for test purposes).
 void execute()
          This is the standard execute() method from Task which must be overwritten.
 java.io.File getJReleaseInfoFile()
          Utility method to check the JReleaseInfo file (for test purposes).
 void setBuildNumFile(java.lang.String fileName)
          Set method for the fileName containing the buildnumber.
 void setBuildNumIncrement(int inc)
          Set method for the buildNumber increment.
 void setBuildNumProperty(java.lang.String buildNumPropertyName)
          Set the build number property name.
 void setClassName(java.lang.String className)
          Set method for the classname of the JReleaseInfo file to be created.
 void setPackageName(java.lang.String packageName)
          Set method for the package of the JReleaseInfo class to be created.
 void setProject(java.lang.String project)
          Set method for the name of the project
 void setTargetDir(java.lang.String targetDir)
          Set method for target directory where the JReleaseInfo file should be created.
 void setVersion(java.lang.String version)
          Set method for the version-number.
 void setWithViewer(boolean isWithViewer)
          Set method for isWithViewer flag
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, init, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JReleaseInfoAntTask

public JReleaseInfoAntTask()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
This is the standard execute() method from Task which must be overwritten.

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

addConfiguredParameter

public void addConfiguredParameter(org.apache.tools.ant.types.Parameter prop)
Set method for any property using the ant type Parameter.

Note: if you define the type, then only use one of these (if you do not define the type, String will be used):

Parameters:
prop - Ant type Parameter

setBuildNumProperty

public void setBuildNumProperty(java.lang.String buildNumPropertyName)
Set the build number property name.

Parameters:
buildNumPropertyName - Name of property.

setBuildNumFile

public void setBuildNumFile(java.lang.String fileName)
Set method for the fileName containing the buildnumber. Note: The fileName should be set with an absolute path.

Parameters:
fileName - Name of buildnumber file

setBuildNumIncrement

public void setBuildNumIncrement(int inc)
Set method for the buildNumber increment.

Parameters:
increment - int

setClassName

public void setClassName(java.lang.String className)
Set method for the classname of the JReleaseInfo file to be created.

Parameters:
className - of the JReleaseInfo

setVersion

public void setVersion(java.lang.String version)
Set method for the version-number.

Parameters:
version - info

setProject

public void setProject(java.lang.String project)
Set method for the name of the project

Parameters:
version - info

setPackageName

public void setPackageName(java.lang.String packageName)
Set method for the package of the JReleaseInfo class to be created.

Parameters:
packageName - of JReleaseInfo class

setTargetDir

public void setTargetDir(java.lang.String targetDir)
Set method for target directory where the JReleaseInfo file should be created. Note: The targetDir should be set as an absolute path.

Parameters:
targetDir - of JReleaseInfo file

deleteJReleaseInfoFile

public void deleteJReleaseInfoFile()
Utility method to delete the JReleaseInfo file (for test purposes).


getJReleaseInfoFile

public java.io.File getJReleaseInfoFile()
Utility method to check the JReleaseInfo file (for test purposes).

Returns:
file with JReleaseInfo

setWithViewer

public void setWithViewer(boolean isWithViewer)
Set method for isWithViewer flag

Parameters:
isWithViewer - flag