org.sadun.util.ant
Class BaseVersion

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.Task
          extended byorg.sadun.util.ant.BaseVersion
Direct Known Subclasses:
Version

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

Author:
Cristiano Sadun

Nested Class Summary
protected  class BaseVersion.VClassLoader
           
 
Field Summary
protected static java.lang.String BUILD_NUMBER_PROPERTY_NAME
           
protected  java.lang.String packageName
           
protected  boolean useExistingVersionClass
           
protected  java.lang.String versionClsPackageName
           
protected  java.lang.String versionFQClsName
           
protected  java.io.File versionInfoPath
           
protected  java.io.File versionObjectBinaryPath
           
protected  java.io.File versionObjectSourcePath
           
protected  java.lang.String versionSimpleClsName
           
 
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
BaseVersion()
           
 
Method Summary
protected  java.lang.String baseName(java.lang.String s)
           
protected  long computeLastBuildNumber()
          Find out the last build number, either by looking in the versionInfo file or looking for an existing object in class path
 void execute()
           
protected  java.lang.String frontName(java.lang.String s)
           
protected  java.util.Properties getExistingBuildNumber()
           
protected  Version getExistingVersionObject()
           
 java.lang.String getPackageName()
           
 java.io.File getVersionInfoPath()
           
 java.io.File getVersionObjectBinaryPath()
           
 java.io.File getVersionObjectSourcePath()
           
protected  java.lang.String mkVersionClsName(java.lang.String packageName)
          Composte the version class name.
 void setPackageName(java.lang.String packageName)
           
 void setVersionInfoPath(java.io.File versionInfoPath)
           
 void setVersionObjectBinaryPath(java.io.File versionObjectPath)
           
 void setVersionObjectSourcePath(java.io.File versionObjectSourcePath)
           
 
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

packageName

protected java.lang.String packageName

versionClsPackageName

protected java.lang.String versionClsPackageName

versionFQClsName

protected java.lang.String versionFQClsName

versionInfoPath

protected java.io.File versionInfoPath

versionSimpleClsName

protected java.lang.String versionSimpleClsName

BUILD_NUMBER_PROPERTY_NAME

protected static final java.lang.String BUILD_NUMBER_PROPERTY_NAME
See Also:
Constant Field Values

useExistingVersionClass

protected boolean useExistingVersionClass

versionObjectBinaryPath

protected java.io.File versionObjectBinaryPath

versionObjectSourcePath

protected java.io.File versionObjectSourcePath
Constructor Detail

BaseVersion

public BaseVersion()
Method Detail

execute

public void execute()
             throws org.apache.tools.ant.BuildException
Throws:
org.apache.tools.ant.BuildException

baseName

protected java.lang.String baseName(java.lang.String s)
Returns:

frontName

protected java.lang.String frontName(java.lang.String s)
Returns:

mkVersionClsName

protected java.lang.String mkVersionClsName(java.lang.String packageName)
Composte the version class name.

Parameters:
packageName -
Returns:

computeLastBuildNumber

protected long computeLastBuildNumber()
                               throws org.apache.tools.ant.BuildException
Find out the last build number, either by looking in the versionInfo file or looking for an existing object in class path

Throws:
org.apache.tools.ant.BuildException

getExistingVersionObject

protected Version getExistingVersionObject()
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getExistingBuildNumber

protected java.util.Properties getExistingBuildNumber()
Returns:

getPackageName

public java.lang.String getPackageName()
Returns:
Returns the packageName.

setPackageName

public void setPackageName(java.lang.String packageName)
Parameters:
packageName - The packageName to set.

getVersionInfoPath

public java.io.File getVersionInfoPath()
Returns:
Returns the versionInfoPath.

getVersionObjectBinaryPath

public java.io.File getVersionObjectBinaryPath()
Returns:
Returns the versionObjectPath.

getVersionObjectSourcePath

public java.io.File getVersionObjectSourcePath()
Returns:
Returns the versionObjectSourcePath.

setVersionInfoPath

public void setVersionInfoPath(java.io.File versionInfoPath)
Parameters:
versionInfoPath - The versionInfoPath to set.

setVersionObjectBinaryPath

public void setVersionObjectBinaryPath(java.io.File versionObjectPath)
Parameters:
versionObjectPath - The versionObjectPath to set.

setVersionObjectSourcePath

public void setVersionObjectSourcePath(java.io.File versionObjectSourcePath)
Parameters:
versionObjectSourcePath - The versionObjectSourcePath to set.