ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: AW: How to detect missing jars in a <path>?
Date Tue, 13 Dec 2005 16:24:54 GMT
To add to the discussion, one way I might do this from
current Ant svn (longer than necessary but including
info):

<pathconvert setonempty="false" property="missing">
  <restrict>
    <path refid="somepath" />
    <not><exists /></not>
  </restrict>
</pathconvert>

<fail message="${missing}" if="missing" />

Note that you would have to use some mechanism for
accessing the not and exists resourceselectors, e.g.

<rsel:not><rsel:exists /></rsel:not>
(with)
<project
xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">

or

<not
xmlns="antlib:org.apache.tools.ant.types.resources.selectors">
  <exists />
</not>

failure only, no properties or info (actually
longer!):

<fail message="missing one or more path elements">
  <condition>
    <resourcecount count="0">
      <restrict>
        <path refid="somepath" />
        <rsel:not><rsel:exists /></rsel:not>
      </restrict>
    </resourcecount>
  </condition>
</fail>

So we could keep adding more, but we already have > 1
way to do this in HEAD.

-Matt

--- Jan.Materne@rzf.fin-nrw.de wrote:

> I think enhancing <available> [1] would be good
> idea:
> 
> <available resource="">
>     <need compare="min|max|exactly"
> number="<integer>|all">
>         <*resource/>
>     </need>
> </available>
> 
> 
> <need> is a resource collection [2]. It combines
> multiple possibilities
> * need exactly 3 of the specified resources
>   <need compare="exactly" number="3">
> * need 3 or more resources
>   <need compare="min" number="3">
> * need 4 or less resources
>   <need compare="max" number="4">
> * nedd all resources - which is the default
>   <need compare="exactly" number="all">
>   because it´s the default just: <need> 
> 
> 
>   <fail message="Missing one resource">
>      <available><need><path
> refid="xyz"/></need></available>
>   </fail>
> 
> 
> Open:
> - naming of the element (<need>)
> - naming of the attributes
>   Are here any other tasks where we can "reuse" the
> names?
> - integration into resource collections
>   Do I use the right scenario or is there something
> else?
> 
> 
> Advantage: <available> would support resources
> (doesnt do it yet) :-)
> 
> 
> 
> Jan
> 
> 
> 
> [1]
>
http://ant.apache.org/manual/CoreTasks/available.html
> [2]
>
http://svn.apache.org/repos/asf/ant/core/trunk/docs/manual/CoreTypes/resources.html#collection
> 
> 
> 
> >-----Ursprüngliche Nachricht-----
> >Von: Bertrand Delacretaz
> [mailto:bdelacretaz@apache.org] 
> >Gesendet: Montag, 12. Dezember 2005 12:18
> >An: Ant Users List
> >Betreff: Re: How to detect missing jars in a
> <path>?
> >
> >Le 12 déc. 05, à 11:57, Steve Loughran a écrit :
> >
> >> ...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)...
> >
> >Thanks for confirming that it doesn't exist yet, I
> was 
> >wondering if I was missing something obvious.
> >
> >> something like
> >> <condition property="missing.path">
> >>   <available pathref="xyz"
> missingpathid="xyz.missing" 
> >> textproperty="message" />
> >> </condition>
> >> <fail if="missing.path">Missing files
> ${message}</fail>
> >
> >Sounds good, I'll try to come up with something in
> my Copious 
> >Free Time...
> >
> >Actually, if the JVMs would check existence of all
> jar files 
> >passed in the classpath, it would make our lives
> easier in many places.
> >
> >-Bertrand
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message