• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

auto-Increment version number.

 
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I was wondering wheather it is possible to auti-increment the version number using Ant itself. My Ant script compiles a Jar file which is name as follows: name-x.y.z.jar, where x represent the major number of the version, y represents the minor number of the version, and z represents the build number. I would like that z (build) be auto-incremented each time I use the build tag to build the jar file. Is this possible?

Regards,
sim085
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at the <buildnumber /> task. I think it is what you are looking for.
[ May 25, 2006: Message edited by: Paul Sturrock ]
 
Simon Joseph Aquilina
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am checking the internet for that tag, and I must admit I did find it . However I can not understand how to use it.


I mean in the page I am reading it says that it loades the build number from a property file that has one of the properties named 'build.number'. Now to create a jar filw I use the following syntax:



So ... where can i place this tag?
I can not do the following for sure



or?

Tanks for your sugestion however
Regards,
sim085
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I can not do the following for sure


True - that is not valid XML. If you read what the task does you'll notice it assigns the build number to a property. And you can use properties any place you like. For example:
 
Simon Joseph Aquilina
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks

I did not understood that in the pages I was reading
Thanks a lot for the example .. that worked fine

Regards (and many thanks again),
sim085
 
Morning came much too soon and it brought along a friend named Margarita Hangover, and a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic