ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject Checking the version of Ant
Date Mon, 15 Jul 2002 14:07:55 GMT

I am currently looking at how I can check the version of Ant used to 
build out software, so that if an 'unsupported' or old version of Ant 
is used, the developer gets a failure message.

I current grab the version string information from Ant (ant -version) 
and store that in a properties file.

Then I have my Ant script read in the properties file, and compare the 
version string with ${ant.version}.

This works great, and I can fail the build if the strings don't match, 
but I have found a couple of issues when testing this check with Ant1.5 
and Ant1.4.1.

I use the <mail> task in Ant1.5 which allows the nested <fileset> 
element, but Ant1.4.1 doesn't support this.

So rather than getting my nice clear failure message, I get:

    Mon 07/15/2002 10:04 C:\beacock\apps\UNIT_T~1>ant
    Buildfile: build.xml


    C:\beacock\apps\UNIT_T~1\build.xml:361: The <mail> task doesn't 
    support the nested "fileset" element.

    Total time: 1 second

Now, I know that this is due to Ant parsing the buildfile with a 
validating XML parser, so would there be anyway that we can 'mark' the 
build.xml with a version string or identifier of some description, so 
that the parser can check the required version against itself as it 

Just a thought...


Andrew Beacock
Principal Software Engineer

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message