ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: How to detect missing jars in a <path>?
Date Mon, 12 Dec 2005 10:57:21 GMT
Bertrand Delacretaz wrote:
> Hi,
> I'd like a construct like
> <path id="xyz">
>   <pathelement path="ok.jar"/>
>   <pathelement path="missing.jar"/>
> </path>
> to fail if missing.jar is not available.
> Is there a way without using a separate <available/> element (which 
> means having the missing.jar name in two places, unless I'm missing 
> something)?
> Making the Path class configurable to cause an error instead of logging 
> the "dropping " + f + " from path as it doesn't exist" could be a 
> solution, but I'm wondering if there's an easier way, without 
> duplicating jar names.

Sounds to me like you've just added a new condition to Ant, Monsieur 
Delacretaz, called something like <pathexists> , which verifies that 
every element in a path is present, logs at -verbose level if one is 
missing (and perhaps sets a property to a filelist/path of missing items).

something like
<condition property="missing.path">
   <available pathref="xyz" missingpathid="xyz.missing" 
textproperty="message" />
<fail if="missing.path">Missing files ${message}</fail>

implementations & tests gratefully accepted


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message