Ant Incremental String Numbers for Zip Code Names

I am doing a project in uni and would like to create zip files whose names (only the build number) increase after each successful build.

What is the easiest way to do this? Is this the case when you need to write a custom task? Or are there some built-in functions that will allow me to do this simply and easily?

I looked through the Zip task manual, but could not find anything useful.

+4
source share
4 answers

Have you seen the BuildNumber task ?

Run this task and then write the zip file based on the property.

+6
source

One simple alternative solution would be to include a timestamp in your file name:

 myapp_20090326-1522.zip for the build made on 2009-03-26 at 15:22. 

This is what many projects do. Also avoids problems if several people can create assemblies on their machines; You do not need to coordinate assembly numbers.

0
source

If you use the Hudson server to create the project, you can use the Hudson build number. Here is a quick example of getting the BUILD_NUMBER environment variable (which is introduced by Hudson):

 <property environment="env" description="System environment variables (including those set by Hudson)"/> <!-- set the build number based on environment variable, otherwise blank --> <condition property="buildNumber" value=".${env.BUILD_NUMBER}" else=""> <isset property="env.BUILD_NUMBER" /> </condition> 
0
source

All Articles