Quantcast

Incrementing Buildnumber to CVS/SVN

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Incrementing Buildnumber to CVS/SVN

daniel.galan
Hi there,

is it possible to access the buildnumber in the ant script?
Or better, to increment a file in the cvs/svn with the current buildnumber?

I ask because it is possible to define a file in anthill, where the current buildnumber is written and commited to the cvs.
With this mechanism we can add the versionnumber/buildnumber to the application builded, and display them e.g. to the user.

Best regards
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incrementing Buildnumber to CVS/SVN

daniel.galan
> is it possible to access the buildnumber in the ant script?
I just discovered the enviroment variables possible in hudson.

But will the other case (commiting to CVS/SVN) be possible?

> Or better, to increment a file in the cvs/svn with the
> current buildnumber?


Greets
Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incrementing Buildnumber to CVS/SVN

Kohsuke Kawaguchi-2
In reply to this post by daniel.galan
[hidden email] wrote:
> Hi there,
>
> is it possible to access the buildnumber in the ant script?

Just so others know, the build number is available to the build via
BUILD_NUMBER environment variable, along with a few other variables. See
the configuration page for the list of all variables.

 > Or better, to increment a file in the cvs/svn with the current
 > buildnumber?

I guess you mean updating a file by the build number, then commit it
back to the SCM.

I'm curious how you fix the chicken and egg problem with that. That
change would trigger another build, isn't it?

> I ask because it is possible to define a file in anthill, where the current buildnumber is written and commited to the cvs.
> With this mechanism we can add the versionnumber/buildnumber to the application builded, and display them e.g. to the user.

In my projects, I access the build number environment variable from Ant
and bake that into the jar file that's built, which in turns show up
when they run "xjc -version".

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Loading...