You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jeff Davidson <JD...@redhawkgaming.com> on 2004/10/22 19:52:14 UTC

Updating "Product version" on each release

Ant-users,

I'm quickly approaching a problem I don't know how to solve.  Here's the
background:

I've got Cruisecontrol monitoring the CVS tree for my project, launching a
delegating Ant file, which in turn launches the individual build files for
each binary that goes into the application (Delphi and C++ projects).  I've
got a plan in place for splitting my current build into an incremental and
master/release build.  Basically, I don't care about the file versions in
the incremental build, and in the master/release build I'll be updating the
individual file versions as appropriate.

Once all the binaries have been compiled and collected, I'm using NSIS [1]
to create three different installers from that collection of binaries (one
Server version, one Client version for NT, and one Client version for 98).
The installers themselves are named using the product version, for example:
FooServer-1.1.0.12.exe.  The file versions of the individual binaries do not
determine the product version (1.1.0.12, in this example).

The source files for the installers are plain-text .nsi files that contain a
line that defines the product version:

	!define PRODUCT_VERSION "1.1.0.12"

That line can easily be replaced by a token, i.e.:

	!define PRODUCT_VERSION "@PRODVER@"

which I can then substitute using a <copy/> with a <filterset/>:

	<filterset>
		<filter token="PRODVER" value="${prod.version}" />
	</filterset>

I'm not concerned about updating the major.minor.release version of the
product version, but I do need to update the fourth number, the build
number, each time I run a master/release build.

I suppose I could use a <filter/> that looks more like this:

	<filter token="PRODVER"
value="${ver.major}.${ver.minor}.${ver.release}.${ver.build}" />

but I still have the issue of... How do I go about retrieving, updating, and
storing the ${ver.build} property?

Any thoughts?  I'm going to play around with storing the property in a
.properties file, which should be relatively simple to read, and update.  I
still have the issue of programmatically updating the property value though.

It seems as though this should be very simple... I just haven't had to do it
before.

Thanks for your help,
~Jeff


[1] http://nsis.sourceforge.net


RE: Updating "Product version" on each release

Posted by Jeff Davidson <JD...@redhawkgaming.com>.
Doh!  Never mind, I just found the <buildnumber/> task.  *sigh*
 

-----Original Message-----
From: Jeff Davidson [mailto:JDavidson@redhawkgaming.com] 
Sent: October 22, 2004 10:52
To: 'Ant Users List'
Subject: Updating "Product version" on each release

Ant-users,

I'm quickly approaching a problem I don't know how to solve.  Here's the
background:

I've got Cruisecontrol monitoring the CVS tree for my project, launching a
delegating Ant file, which in turn launches the individual build files for
each binary that goes into the application (Delphi and C++ projects).  I've
got a plan in place for splitting my current build into an incremental and
master/release build.  Basically, I don't care about the file versions in
the incremental build, and in the master/release build I'll be updating the
individual file versions as appropriate.

Once all the binaries have been compiled and collected, I'm using NSIS [1]
to create three different installers from that collection of binaries (one
Server version, one Client version for NT, and one Client version for 98).
The installers themselves are named using the product version, for example:
FooServer-1.1.0.12.exe.  The file versions of the individual binaries do not
determine the product version (1.1.0.12, in this example).

The source files for the installers are plain-text .nsi files that contain a
line that defines the product version:

	!define PRODUCT_VERSION "1.1.0.12"

That line can easily be replaced by a token, i.e.:

	!define PRODUCT_VERSION "@PRODVER@"

which I can then substitute using a <copy/> with a <filterset/>:

	<filterset>
		<filter token="PRODVER" value="${prod.version}" />
	</filterset>

I'm not concerned about updating the major.minor.release version of the
product version, but I do need to update the fourth number, the build
number, each time I run a master/release build.

I suppose I could use a <filter/> that looks more like this:

	<filter token="PRODVER"
value="${ver.major}.${ver.minor}.${ver.release}.${ver.build}" />

but I still have the issue of... How do I go about retrieving, updating, and
storing the ${ver.build} property?

Any thoughts?  I'm going to play around with storing the property in a
.properties file, which should be relatively simple to read, and update.  I
still have the issue of programmatically updating the property value though.

It seems as though this should be very simple... I just haven't had to do it
before.

Thanks for your help,
~Jeff


[1] http://nsis.sourceforge.net



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org