You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stephen Oostenbrink <st...@hotmail.com> on 2001/09/08 14:34:52 UTC

BuildInfo Task

Hi,

I have created a task that creates a release version using a property files
as its input.

The release version has the following format:


        <release number>_<build number>_[date stamp]

- release number: Is the release number for this version of the application.
This number is formatted in the form X_Y_Z, where X is the major build
number, Y the minor build number and Z the patch number.
- build number: Is the number of builds that have been performed for the
current release. This number is increased after each call to the task.
- date stamp: optionally a date stamp can be added to the release version.

This release version can be used to name a release package so that it is
easily identified (example: my_app_1_0_0_35.zip). If required the property
file can be added to the applications jar file. Using a utility class this
information can be displayed and used by customers to indicate what version
/ build of an application they are using

Each time this task is called the build number is increased and the new
build number, build platform and the build date is written back to the
property file.

I would like to submit this task and the example utility class, that
displays the build information, as an enhancement. Does anyone think this
could be a handy enhancement? And if so how do I go about submitting it?

- Stephen

BuildInfo Task - CORRECTION

Posted by Stephen Oostenbrink <st...@hotmail.com>.
CORRECTION

major build number --> major release number
minor build number --> minor release number

----

Hi,

I have created a task that creates a release version using a property files
as its input.

The release version has the following format:


         <release number>_<build number>_[date stamp]

- release number: Is the release number for this version of the application.
This number is formatted in the form X_Y_Z, where X is the major release
number, Y the minor release number and Z the patch number.
- build number: Is the number of builds that have been performed for the
current release. This number is increased after each call to the task.
- date stamp: optionally a date stamp can be added to the release version.

 This release version can be used to name a release package so that it is
easily identified (example: my_app_1_0_0_35.zip). If required the property
file can be added to the applications jar file. Using a utility class this
information can be displayed and used by customers to indicate what version
/ build of an application they are using

Each time this task is called the build number is increased and the new
build number, build platform and the build date is written back to the
property file.

I would like to submit this task and the example utility class, that
displays the build information, as an enhancement. Does anyone think this
could be a handy enhancement? And if so how do I go about submitting it?

 - Stephen


BuildInfo Task - CORRECTION

Posted by Stephen Oostenbrink <st...@hotmail.com>.
CORRECTION

major build number --> major release number
minor build number --> minor release number

----

Hi,

I have created a task that creates a release version using a property files
as its input.

The release version has the following format:


         <release number>_<build number>_[date stamp]

- release number: Is the release number for this version of the application.
This number is formatted in the form X_Y_Z, where X is the major release
number, Y the minor release number and Z the patch number.
- build number: Is the number of builds that have been performed for the
current release. This number is increased after each call to the task.
- date stamp: optionally a date stamp can be added to the release version.

 This release version can be used to name a release package so that it is
easily identified (example: my_app_1_0_0_35.zip). If required the property
file can be added to the applications jar file. Using a utility class this
information can be displayed and used by customers to indicate what version
/ build of an application they are using

Each time this task is called the build number is increased and the new
build number, build platform and the build date is written back to the
property file.

I would like to submit this task and the example utility class, that
displays the build information, as an enhancement. Does anyone think this
could be a handy enhancement? And if so how do I go about submitting it?

 - Stephen

Re: BuildInfo Task

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
[sorry if this came through twice, I'm rearranging the e-mail addresses I'm
using to subscribe to lists]

You can put the os.name property (or any other Ant built-in or user-defined
property) in a property file using the <propertyfile> task.   Here's how I
do it:

    <propertyfile comment="Build Information"
file="${build.dir}/classes/version.properties">
        <entry key="version" value="${version}"/>
        <entry key="build.date" pattern="EEEE MMM dd, yyyy" type="date"
value="now"/>
        <entry key="build.time" pattern="kk:mm:ss" type="date" value="now"/>
        <entry key="build.host" value="${env.COMPUTERNAME}"/>
        <entry key="build.user.name" value="${user.name}"/>
        <entry key="build.os.name" value="${os.name}"/>
        <entry key="cvs.tag" value="${cvs.tag}"/>
    </propertyfile>

Yes, it would take a couple of steps to auto-increment a number in a
properties file, then load that properties file to get its value for use in
file naming.

    Erik



----- Original Message -----
From: "Stephen Oostenbrink" <st...@hotmail.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, September 08, 2001 11:30 AM
Subject: Re: BuildInfo Task


> Erik,
>
> Hmmm this is kind of what I have done. Looking at the description the only
> information I would not be able to set using the PropertyFile task is the
> operating system the build is done on. I get this using the system
property
> 'os.name'. I guess the task could be extend to incorporate this
> functionality. I am guessing I would first have to run the PropertyFile
task
> and then load the property file, so that I could use the the properties to
> create the release version to append to the zip file name I am generating.
>
> Thanks for the feedback.
>
> Stephen
>
> ----- Original Message -----
> From: "Erik Hatcher" <er...@earthlink.net>
> To: <an...@jakarta.apache.org>
> Sent: Saturday, September 08, 2001 5:38 PM
> Subject: Re: BuildInfo Task
>
>
> > Stephen,
> >
> > How does your task differ from the functionality already available in
the
> > optional <propertyfile> task?  (IMHO, this should be a built-in task).
> >
> > I'm accomplishing something similar to what you describe by building a
> > version.properties file into a WAR file and have written a bean accessor
> > class for it as well as a Taglib that allows the version to be shown in
> JSP
> > pages easily.  I'm currently not doing any auto-incrementing, just
> capturing
> > the CVS tag that was used in the build, but <propertyfile> can do
> > incrementing/decrementing of int and date property values and appending
of
> > string values.
> >
> >     Erik
> >
> > ----- Original Message -----
> > From: "Stephen Oostenbrink" <st...@hotmail.com>
> > To: <an...@jakarta.apache.org>
> > Cc: <st...@accenture.com>
> > Sent: Saturday, September 08, 2001 5:34 AM
> > Subject: BuildInfo Task
> >
> >
> > > Hi,
> > >
> > > I have created a task that creates a release version using a property
> > files
> > > as its input.
> > >
> > > The release version has the following format:
> > >
> > >
> > >         <release number>_<build number>_[date stamp]
> > >
> > > - release number: Is the release number for this version of the
> > application.
> > > This number is formatted in the form X_Y_Z, where X is the major build
> > > number, Y the minor build number and Z the patch number.
> > > - build number: Is the number of builds that have been performed for
the
> > > current release. This number is increased after each call to the task.
> > > - date stamp: optionally a date stamp can be added to the release
> version.
> > >
> > > This release version can be used to name a release package so that it
is
> > > easily identified (example: my_app_1_0_0_35.zip). If required the
> property
> > > file can be added to the applications jar file. Using a utility class
> this
> > > information can be displayed and used by customers to indicate what
> > version
> > > / build of an application they are using
> > >
> > > Each time this task is called the build number is increased and the
new
> > > build number, build platform and the build date is written back to the
> > > property file.
> > >
> > > I would like to submit this task and the example utility class, that
> > > displays the build information, as an enhancement. Does anyone think
> this
> > > could be a handy enhancement? And if so how do I go about submitting
it?
> > >
> > > - Stephen
> >
> >


Re: BuildInfo Task

Posted by Erik Hatcher <er...@earthlink.net>.
You can put the os.name property (or any other Ant built-in or user-defined
property) in a property file using the <propertyfile> task.   Here's how I
do it:

    <propertyfile comment="Build Information"
file="${build.dir}/classes/version.properties">
        <entry key="version" value="${version}"/>
        <entry key="build.date" pattern="EEEE MMM dd, yyyy" type="date"
value="now"/>
        <entry key="build.time" pattern="kk:mm:ss" type="date" value="now"/>
        <entry key="build.host" value="${env.COMPUTERNAME}"/>
        <entry key="build.user.name" value="${user.name}"/>
        <entry key="build.os.name" value="${os.name}"/>
        <entry key="cvs.tag" value="${cvs.tag}"/>
    </propertyfile>

Yes, it would take a couple of steps to auto-increment a number in a
properties file, then load that properties file to get its value for use in
file naming.

    Erik

----- Original Message -----
From: "Stephen Oostenbrink" <st...@hotmail.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, September 08, 2001 11:30 AM
Subject: Re: BuildInfo Task


> Erik,
>
> Hmmm this is kind of what I have done. Looking at the description the only
> information I would not be able to set using the PropertyFile task is the
> operating system the build is done on. I get this using the system
property
> 'os.name'. I guess the task could be extend to incorporate this
> functionality. I am guessing I would first have to run the PropertyFile
task
> and then load the property file, so that I could use the the properties to
> create the release version to append to the zip file name I am generating.
>
> Thanks for the feedback.
>
> Stephen
>
> ----- Original Message -----
> From: "Erik Hatcher" <er...@earthlink.net>
> To: <an...@jakarta.apache.org>
> Sent: Saturday, September 08, 2001 5:38 PM
> Subject: Re: BuildInfo Task
>
>
> > Stephen,
> >
> > How does your task differ from the functionality already available in
the
> > optional <propertyfile> task?  (IMHO, this should be a built-in task).
> >
> > I'm accomplishing something similar to what you describe by building a
> > version.properties file into a WAR file and have written a bean accessor
> > class for it as well as a Taglib that allows the version to be shown in
> JSP
> > pages easily.  I'm currently not doing any auto-incrementing, just
> capturing
> > the CVS tag that was used in the build, but <propertyfile> can do
> > incrementing/decrementing of int and date property values and appending
of
> > string values.
> >
> >     Erik
> >
> > ----- Original Message -----
> > From: "Stephen Oostenbrink" <st...@hotmail.com>
> > To: <an...@jakarta.apache.org>
> > Cc: <st...@accenture.com>
> > Sent: Saturday, September 08, 2001 5:34 AM
> > Subject: BuildInfo Task
> >
> >
> > > Hi,
> > >
> > > I have created a task that creates a release version using a property
> > files
> > > as its input.
> > >
> > > The release version has the following format:
> > >
> > >
> > >         <release number>_<build number>_[date stamp]
> > >
> > > - release number: Is the release number for this version of the
> > application.
> > > This number is formatted in the form X_Y_Z, where X is the major build
> > > number, Y the minor build number and Z the patch number.
> > > - build number: Is the number of builds that have been performed for
the
> > > current release. This number is increased after each call to the task.
> > > - date stamp: optionally a date stamp can be added to the release
> version.
> > >
> > > This release version can be used to name a release package so that it
is
> > > easily identified (example: my_app_1_0_0_35.zip). If required the
> property
> > > file can be added to the applications jar file. Using a utility class
> this
> > > information can be displayed and used by customers to indicate what
> > version
> > > / build of an application they are using
> > >
> > > Each time this task is called the build number is increased and the
new
> > > build number, build platform and the build date is written back to the
> > > property file.
> > >
> > > I would like to submit this task and the example utility class, that
> > > displays the build information, as an enhancement. Does anyone think
> this
> > > could be a handy enhancement? And if so how do I go about submitting
it?
> > >
> > > - Stephen
> >
> >


Re: BuildInfo Task

Posted by Stephen Oostenbrink <st...@hotmail.com>.
Erik,

Hmmm this is kind of what I have done. Looking at the description the only
information I would not be able to set using the PropertyFile task is the
operating system the build is done on. I get this using the system property
'os.name'. I guess the task could be extend to incorporate this
functionality. I am guessing I would first have to run the PropertyFile task
and then load the property file, so that I could use the the properties to
create the release version to append to the zip file name I am generating.

Thanks for the feedback.

Stephen

----- Original Message -----
From: "Erik Hatcher" <er...@earthlink.net>
To: <an...@jakarta.apache.org>
Sent: Saturday, September 08, 2001 5:38 PM
Subject: Re: BuildInfo Task


> Stephen,
>
> How does your task differ from the functionality already available in the
> optional <propertyfile> task?  (IMHO, this should be a built-in task).
>
> I'm accomplishing something similar to what you describe by building a
> version.properties file into a WAR file and have written a bean accessor
> class for it as well as a Taglib that allows the version to be shown in
JSP
> pages easily.  I'm currently not doing any auto-incrementing, just
capturing
> the CVS tag that was used in the build, but <propertyfile> can do
> incrementing/decrementing of int and date property values and appending of
> string values.
>
>     Erik
>
> ----- Original Message -----
> From: "Stephen Oostenbrink" <st...@hotmail.com>
> To: <an...@jakarta.apache.org>
> Cc: <st...@accenture.com>
> Sent: Saturday, September 08, 2001 5:34 AM
> Subject: BuildInfo Task
>
>
> > Hi,
> >
> > I have created a task that creates a release version using a property
> files
> > as its input.
> >
> > The release version has the following format:
> >
> >
> >         <release number>_<build number>_[date stamp]
> >
> > - release number: Is the release number for this version of the
> application.
> > This number is formatted in the form X_Y_Z, where X is the major build
> > number, Y the minor build number and Z the patch number.
> > - build number: Is the number of builds that have been performed for the
> > current release. This number is increased after each call to the task.
> > - date stamp: optionally a date stamp can be added to the release
version.
> >
> > This release version can be used to name a release package so that it is
> > easily identified (example: my_app_1_0_0_35.zip). If required the
property
> > file can be added to the applications jar file. Using a utility class
this
> > information can be displayed and used by customers to indicate what
> version
> > / build of an application they are using
> >
> > Each time this task is called the build number is increased and the new
> > build number, build platform and the build date is written back to the
> > property file.
> >
> > I would like to submit this task and the example utility class, that
> > displays the build information, as an enhancement. Does anyone think
this
> > could be a handy enhancement? And if so how do I go about submitting it?
> >
> > - Stephen
>
>

Re: BuildInfo Task

Posted by Erik Hatcher <er...@earthlink.net>.
Stephen,

How does your task differ from the functionality already available in the
optional <propertyfile> task?  (IMHO, this should be a built-in task).

I'm accomplishing something similar to what you describe by building a
version.properties file into a WAR file and have written a bean accessor
class for it as well as a Taglib that allows the version to be shown in JSP
pages easily.  I'm currently not doing any auto-incrementing, just capturing
the CVS tag that was used in the build, but <propertyfile> can do
incrementing/decrementing of int and date property values and appending of
string values.

    Erik

----- Original Message -----
From: "Stephen Oostenbrink" <st...@hotmail.com>
To: <an...@jakarta.apache.org>
Cc: <st...@accenture.com>
Sent: Saturday, September 08, 2001 5:34 AM
Subject: BuildInfo Task


> Hi,
>
> I have created a task that creates a release version using a property
files
> as its input.
>
> The release version has the following format:
>
>
>         <release number>_<build number>_[date stamp]
>
> - release number: Is the release number for this version of the
application.
> This number is formatted in the form X_Y_Z, where X is the major build
> number, Y the minor build number and Z the patch number.
> - build number: Is the number of builds that have been performed for the
> current release. This number is increased after each call to the task.
> - date stamp: optionally a date stamp can be added to the release version.
>
> This release version can be used to name a release package so that it is
> easily identified (example: my_app_1_0_0_35.zip). If required the property
> file can be added to the applications jar file. Using a utility class this
> information can be displayed and used by customers to indicate what
version
> / build of an application they are using
>
> Each time this task is called the build number is increased and the new
> build number, build platform and the build date is written back to the
> property file.
>
> I would like to submit this task and the example utility class, that
> displays the build information, as an enhancement. Does anyone think this
> could be a handy enhancement? And if so how do I go about submitting it?
>
> - Stephen