ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Trump <trump.ja...@gmail.com>
Subject Re: Check that path elements exist?
Date Thu, 15 Apr 2010 19:47:47 GMT
that's a clever formula.  is there an 'ant cookbook' somewhere on the web to
collect stuff like this?  sorry to be slightly off-topic, but seems like it
would be a valuable community resource.

jason

On Wed, Apr 14, 2010 at 9:01 PM, Stefan Bodewig <bodewig@apache.org> wrote:

> On 2010-04-15, Jeffrey E Care <carej@us.ibm.com> wrote:
>
> > Before I write my own, if there a way to check that the elements of a
> path
> > actually exist (or optionally that at least one exists)?
>
> I assume you mean the <pathelement>'s of a <path>.  <resourcecount>,
> <restrict> and <exists> are the ingredients that should help.
>
> If you wrap your <path> in a <restrict> using <exists> as selector
you
> get only the existing elements.  <resourcecount> will count them and if
> it is greater than 0 you obviously have at least one - likewise if you
> count the path itself and compare the numbers you'll know whether all
> elements exist.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message