Reputation: 249
I have a jar file in /programs/src
i want my program to print a message that it is present in the directory:
<if>
<available file="**/*.jar" />
<then>
<echo message="Available" />
</then>
<else>
<echo message="Not Available" />
</else>
but it is not working
Upvotes: 0
Views: 112
Reputation: 10377
You may use the builtin ${toString:yourfilesetid}
mechanism from ant combined with
Ant Addon Flaka like that :
<project name="demo" xmlns:fl="antlib:it.haefelinger.flaka">
<fileset dir="/home/rosebud/temp" includes="**/*.jar" id="foobar"/>
<fl:choose>
<fl:when test=" '${toString:foobar}' ne '' ">
<echo message="Available" />
<!-- .. other stuff -->
</fl:when>
<fl:otherwise>
<echo message="Not Available" />
<!-- .. other stuff -->
</fl:otherwise>
</fl:choose>
</project>
Upvotes: 0
Reputation: 403611
There's nothing in the documentation for <available>
that says it can handle wildcards. You need to use an actual file path.
Upvotes: 1