You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Vadim Tkachenko <vt...@freehold.crocodile.org> on 2001/11/01 23:37:18 UTC

Ant version recognition

Hello,

Sorry if this topic has been discussed previously - I couldn't find the
references.

The problem I want to solve is quite simple - how to give the build process
the ability to request a specific Ant version - for example, how do I
explicitly tell the user that Ant 1.3 would not be able to work with this
specific build file? Currently, the content of the ${ant.version} is
something like this:

	Ant version 1.4 compiled on October 2 2001

This is, of course, human readable, but useless for the build process just
because the specific Ant distribution may have been compiled on the
different date.

There are a few possible solutions.

One, restrict the content of ${ant.version} to something as simple as "1.4"
and provide additional predefined variable like ${ant.build.info} or
something like that. This will allow to create conditionals based on the
string value of the version. The benefit is the minimum amount of changes
required. The drawback is obvious - it breaks the existing behavior and
doesn't protect from weird things like version "1.4experimental2alpha10b".
Also, in this case the hassle of maintaining the check is on the user.

The other is introduce a simple task identical to AC_PREREQ in autoconf that
will have one and only purpose: ensure that the running version of Ant is
able to handle the build file being run. The benefit is that the syntax is
much simpler, the drawback is that this task has to be referenced early
enough - lack of clarity, though not as bad as the option above.

And the third option, probably simplest from the user standpoint, is an
[optional] attribute to the <project> element specifying which version of
Ant is required to run this build file.

Any comments? I hope I haven't missed anything...

--vt

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant version recognition

Posted by Peter Donald <do...@apache.org>.
On Fri, 2 Nov 2001 09:37, Vadim Tkachenko wrote:
> And the third option, probably simplest from the user standpoint, is an
> [optional] attribute to the <project> element specifying which version of
> Ant is required to run this build file.

+1

-- 
Cheers,

Pete

---------------------------------------------
 We shall not cease from exploration, and the 
  end of all our exploring will be to arrive 
 where we started and know the place for the 
        first time -- T.S. Eliot
---------------------------------------------

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>