Sorry, for hitting the wrong button! Michael,
have you given something like <antlib> <condition property="svn.type.found"> <typefound name="svn"/> </condition> </antlib> a try? What do you get?? This is what I get: tryme.xml:4: The following error occurred while executing this line: Invalid task in antlib condition class org.apache.tools.ant.TaskAdapter does not extend org.apache.tools.ant.taskdefs.AntlibDefinition My understanding of Antlib has always been, that you can provide task, types, macros etc while there is no way to execute tasks or macros. Perhaps my understanding is wrong. As mentioned, a <componentdef /> is not a 1.7 feature. Still I would like to offer one antlib (namespace) regardless whether using 1.8 or 1.7. (or older). Regards. On Fri, Nov 12, 2010 at 2:49 PM, wolfgang haefelinger <whaefelin...@gmail.com> wrote: > Hello Michael, > > have you given something like > > <antlib> > <condition property="svn.type.found"> > <typefound name="svn"/> > > > > On Fri, Nov 12, 2010 at 2:04 PM, Ludwig, Michael > <michael.lud...@delphi-mb.de> wrote: >> 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-unsubscr...@ant.apache.org >> For additional commands, e-mail: user-h...@ant.apache.org >> >> > > > > -- > Wolfgang Häfelinger > häfelinger IT - Applied Software Architecture > http://www.haefelinger.it > +31 648 27 61 59 > -- Wolfgang Häfelinger häfelinger IT - Applied Software Architecture http://www.haefelinger.it +31 648 27 61 59 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org