Hi Peter,

Firstly, thanks for your pointer - and you are correct.
I *had* copied the ivy jar into Ant 1.7 but not 1.8 (I thought I had copied it into neither).

Secondly, I couldn't see why the <taskdef> element should not do as I expected. I took the <typedef> definition from the Ivy documentation, and confirmed it against the Ant documentation

After quite some trial and error, it turns out that the problem isn't with the <typedef> element, but the <available> element.

So, in case this helps anyone else:
Apparently, even though the <typedef> correctly adds the ivy types to Ant so they can be used anywhere in the project file, they aren't added in a way that <available> will find by default. So adding a classpathref="ivy.lib.path" to the <available> element got it working.

So the modified <available> element becomes:

<available classname="org.apache.ivy.ant.IvyConfigure"
         property="ivy.present" classpathref="ivy.lib.path" />

Thanks all again for the pointers.

Cheers!
Nik

On 03/31/2010 09:36 AM, Peter Reilly wrote:
I do not see how this would work in ant 1.7, unless
you have the ivy jars in $ant.home/lib

Peter

On Tue, Mar 30, 2010 at 9:15 AM, Nik<[email protected]>  wrote:
Hi I recently upgraded from Ant 1.7 to Ant 1.8.

One feature of my existing Ant files that seems to no longer work is the
<available>  element.

I have the following in my global Ant file to detect Ivy:

<!-- add a searchpath to find the ivy jars -->
<path id="ivy.lib.path">
<fileset dir="${ivy.home}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
       uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>

<!-- check to see if Ivy is available -->
<available classname="org.apache.ivy.ant.IvyConfigure"
         property="ivy.present" />

<echo message="Ivy detected: ${ivy.present}" />

Under Ant 1.7, this works and the message shows:

     [echo] Ivy detected: true

Under Ant 1.8, this fails, and the message shows:

     [echo] Ivy detected: ${ivy.present}

Looking at the Ant file, it seems pretty clear that the "ivy.present"
property has not been set by the<available>  element.

Has anybody else noticed any issues in this area?

Cheers!
Nik

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to