ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ludwig, Michael" <Michael.Lud...@delphi-mb.de>
Subject RE: conditions in antlib?
Date Fri, 12 Nov 2010 13:04:57 GMT
Moin Wolfgang,

> I want to provide a *single antlib* with the following requirements:
> (a) must work with Ant 1.7.x and newer
> (b) uses <componentdef />  appearing to be a 1.8.x feature.

> don't we need a conditional component-, type-,
> macrodef and  taskdef definition??

You could parse ${ant.version}.

ant.version=Apache Ant version 1.8.1 compiled on April 30 2010

<project>
<echoproperties prefix="ant"/>
</project>

> <antlib xmlns:c="ant:current">
>   <ifver  gt="1.8.0" eq="1.8.0">
>     <componentdef name=".." .. />

A better solution would be to check for the availability of
the type you intend to use, like this:

<condition property="svn.type.found">
  <and>
    <typefound name="svn"/>
    <typefound name="svnFileSet"/>
    <typefound name="svnAdded"/><!-- etc -->
    <typefound name="svnExists"/>
  </and>
</condition>

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message