org.clapper.util.misc
Class BuildInfo

java.lang.Object
  extended by org.clapper.util.misc.BuildInfo

public class BuildInfo
extends java.lang.Object

Contains constants for defining and accessing build info. Also acts as a base class for specific packages' classes that retrieve package build data.

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

Field Summary
static java.lang.String BUILD_ANT_VERSION_KEY
          The key to retrieve the version of Ant used for the build.
static java.lang.String BUILD_COMPILER_KEY
          The key to retrieve the compiler used for the build.
static java.lang.String BUILD_DATE_KEY
          The build date, in "raw" (internal, numeric) form.
static java.lang.String BUILD_ID_DATE_FORMAT_STRING
          The date format, used with java.text.SimpleDateFormat, used to create the build ID.
static java.lang.String BUILD_ID_KEY
          The build ID, really just the time in a compressed format.
static java.lang.String BUILD_OS_KEY
          The key to retrieve the operating system where the build occurred.
static java.lang.String BUILD_VM_KEY
          The key to retrieve the VM used for the build.
static java.lang.String BUILT_BY_KEY
          The user and host where the build occurred.
static java.lang.String DATE_FORMAT_STRING
          The date format, used with java.text.SimpleDateFormat, used to write the date string to the build file.
 
Constructor Summary
BuildInfo(java.lang.String bundleName)
          Constructor.
 
Method Summary
 java.lang.String getBuildAntVersion()
          Get the version of Ant used during the build process.
 java.lang.String getBuildDate()
          Get the build date, as a string, from the resource bundle.
 java.lang.String getBuildID()
          Get the build ID string.
 java.lang.String getBuildJavaCompiler()
          Get the Java compiler used during the build.
 java.lang.String getBuildJavaVM()
          Get the string that identifies the Java virtual machine that was used during the build.
 java.lang.String getBuildOperatingSystem()
          Get the string that identifies the operating system where the build occurred.
 java.lang.String getBuildUserID()
          Get the string that identifies the user who built the software.
static void makeBuildInfoBundle(java.io.File bundleFile, java.lang.String javaCompiler, java.lang.String antVersion)
          Update the build bundle file.
 void showBuildInfo(java.io.PrintStream out)
          Display build information to the specified PrintStream.
 void showBuildInfo(java.io.PrintWriter out)
          Display build information to the specified PrintWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILD_OS_KEY

public static final java.lang.String BUILD_OS_KEY
The key to retrieve the operating system where the build occurred.

See Also:
Constant Field Values

BUILD_VM_KEY

public static final java.lang.String BUILD_VM_KEY
The key to retrieve the VM used for the build.

See Also:
Constant Field Values

BUILD_COMPILER_KEY

public static final java.lang.String BUILD_COMPILER_KEY
The key to retrieve the compiler used for the build.

See Also:
Constant Field Values

BUILD_ANT_VERSION_KEY

public static final java.lang.String BUILD_ANT_VERSION_KEY
The key to retrieve the version of Ant used for the build.

See Also:
Constant Field Values

BUILD_DATE_KEY

public static final java.lang.String BUILD_DATE_KEY
The build date, in "raw" (internal, numeric) form.

See Also:
Constant Field Values

BUILT_BY_KEY

public static final java.lang.String BUILT_BY_KEY
The user and host where the build occurred.

See Also:
Constant Field Values

BUILD_ID_KEY

public static final java.lang.String BUILD_ID_KEY
The build ID, really just the time in a compressed format.

See Also:
Constant Field Values

DATE_FORMAT_STRING

public static final java.lang.String DATE_FORMAT_STRING
The date format, used with java.text.SimpleDateFormat, used to write the date string to the build file. This format can also be used to parse the date string, if necessary.

See Also:
Constant Field Values

BUILD_ID_DATE_FORMAT_STRING

public static final java.lang.String BUILD_ID_DATE_FORMAT_STRING
The date format, used with java.text.SimpleDateFormat, used to create the build ID.

See Also:
Constant Field Values
Constructor Detail

BuildInfo

public BuildInfo(java.lang.String bundleName)
Constructor.

Parameters:
bundleName - the resource bundle containing the build info
Method Detail

getBuildDate

public java.lang.String getBuildDate()
Get the build date, as a string, from the resource bundle.

Returns:
the build date, as a string

getBuildUserID

public java.lang.String getBuildUserID()
Get the string that identifies the user who built the software. Typically, this string contains both the user ID and the host where the build occurred.

Returns:
the user identification string

getBuildOperatingSystem

public java.lang.String getBuildOperatingSystem()
Get the string that identifies the operating system where the build occurred.

Returns:
the operating system string

getBuildID

public java.lang.String getBuildID()
Get the build ID string.

Returns:
the build ID string

getBuildJavaVM

public java.lang.String getBuildJavaVM()
Get the string that identifies the Java virtual machine that was used during the build.

Returns:
the Java VM string

getBuildJavaCompiler

public java.lang.String getBuildJavaCompiler()
Get the Java compiler used during the build.

Returns:
the Java compiler string

getBuildAntVersion

public java.lang.String getBuildAntVersion()
Get the version of Ant used during the build process.

Returns:
the Ant version string

makeBuildInfoBundle

public static void makeBuildInfoBundle(java.io.File bundleFile,
                                       java.lang.String javaCompiler,
                                       java.lang.String antVersion)
                                throws java.io.IOException
Update the build bundle file.

Parameters:
bundleFile - the path to the properties file
javaCompiler - Java compiler name, or null if not known
antVersion - Ant version, or null if not known
Throws:
java.io.IOException - Can't recreate file.

showBuildInfo

public void showBuildInfo(java.io.PrintStream out)
Display build information to the specified PrintStream.

Parameters:
out - where to write the build information
See Also:
showBuildInfo(PrintWriter)

showBuildInfo

public void showBuildInfo(java.io.PrintWriter out)
Display build information to the specified PrintWriter.

Parameters:
out - where to write the build information
See Also:
showBuildInfo(PrintStream)


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