I started off using the buildnumber task to let IVY control the build number 
for CI, but then found it difficult to tell the CI tool what the version number 
was that IVY selected.  Obvioulsy, it is better if the version number used by 
CI matches the version used by IVY.  Therefore, I switched to NOT use the 
buildnumber task and let the CI tool choose the number and pass it to IVY as a 
environment variable or ant property that can be passed into the ant command 
line.  When developers do their own builds outside of the CI system, the 
buildnumber is hardcoded to "LOCAL".

As far as updating XML, the xmltask from oops consultancy is perfect.  I have 
been able to do everything I need for parsing and editing with that task.

---
Shawn Castrianni


-----Original Message-----
From: Mitch Gitman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 19, 2008 10:13 AM
To: [EMAIL PROTECTED]
Subject: buildnumber Ant task & automated updates of ivy.xml

There's one Ivy Ant task that had been flying under my radar, the
buildnumber <http://ant.apache.org/ivy/history/trunk/use/buildnumber.html>task.

It seems to me that the natural use for the *buildnumber *task is during a
build invoked by continuous integration. A CI-invoked Ant target would go
into an ivy.xml file and update the /ivy-module/[EMAIL PROTECTED] attribute with
the ivy.new.revision property value obtained from *buildnumber*. This could
come into play when, under "Dealing with integration versions" on the the Ivy
Best Practices page<http://ant.apache.org/ivy/history/trunk/bestpractices.html>,
you take the "create automatically a new version for each" approach.

I'd be interested in hearing what other uses folks have found for the
*buildnumber
*task.

Also (and actually this has nothing particularly to do with *buildnumber*),
I'd be interested in hearing what mechanisms folks are doing for doing an
automated update of ivy.xml files. Besides the
/ivy-module/[EMAIL PROTECTED] attribute,
there's the /ivy-module/dependencies/[EMAIL PROTECTED] attribute, which also
can be a good candidate for automated updates in certain situations.

I can think of two ways of automatically updating the content of an ivy.xml
file:

   - Use regular expressions. Advantage: everything's right there in the
   build.xml. Disadvantage: regular expressions. Yuck!
   - Manipulate the XML programmatically, such as by binding Java objects to
   the XML schema. This has the disadvantage of requiring Java code (and
   possibly an additional library not already in the classpath), so you'd have
   to create a separate Ant task or Java executable.

Or is there some other mechanism already out there in some Ant task (Ivy or
non-Ivy) that I'm missing, like I'd missed the *buildnumber *task for a
while?

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

Reply via email to