ch.oscg.jreleaseinfo.anttask
Class JReleaseInfoAntTask

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended bych.oscg.jreleaseinfo.anttask.JReleaseInfoAntTask

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

Field Summary
protected  BuildNumberHandlerIF buildNumberHandler
          Build number handler
protected  java.lang.String buildNumPropertyName
          Build number property name
protected  JReleaseInfoBean creator
          Generator for build info source file.
protected  boolean isWithViewer
          Flag for additional viewer code
protected  java.util.Map props
          Membervariables for created class.
 
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
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).
protected  boolean isRelativePath(java.lang.String path)
          Utility method to check if a path is relative.
 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
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
 

Field Detail

props

protected java.util.Map props
Membervariables for created class.


creator

protected JReleaseInfoBean creator
Generator for build info source file.


buildNumberHandler

protected BuildNumberHandlerIF buildNumberHandler
Build number handler


isWithViewer

protected boolean isWithViewer
Flag for additional viewer code


buildNumPropertyName

protected java.lang.String buildNumPropertyName
Build number property name

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.

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.


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


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

isRelativePath

protected boolean isRelativePath(java.lang.String path)
Utility method to check if a path is relative.

Parameters:
path -
Returns:
true/false


Copyright © 2005 Open Source Competence Group (OSCG). All Rights Reserved.