Showing posts with label ant. Show all posts
Showing posts with label ant. Show all posts

Sunday, October 23, 2016

A poor man's Ant build number incrementer

Note: this was originally posted November 17, 2009 on my old blog.

Our situation: our build server uses Ant to automatically get the latest versions of the source files, build the application and deploy it.  A build number is updated in a properties file, but we lost the ability to check that file back into source control. (no write access for build user to source control server). This means the build number, say 500, is always incremented to 501, packaged into the war file, and sent out on the server.  The next night, another automated build kicks off and the properties file is retrieved with the current build number set at 500.  So the build process dutifully adds one to it, builds and packages the application and sends it off to the server with the build number at 501.  Again.

We needed a way to increment the build number to accurately reflect that a new build is generated and put out on the server - this helps not only to keep tabs on how many times we build the application, but the build number is also used as a random salt in the request parameters to prevent caching issues with browsers.

Monday, April 18, 2011

How to set up an Apache Ant macrodef

Note: this was originally posted December 29, 2010 on my old blog.

Overview


This blog post will go over how to set up a somewhat trivial macrodef in Apache Ant.  Ant basics are assumed.