You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Konstantinos Karadamoglou <kk...@googlemail.com> on 2006/03/15 17:27:39 UTC

How to avoid redundat path and fileset declerations

Hello all,

I am new to this mailing list.

I have a question about avoiding redundancy when declaring paths and filesets.

A lot of times I declare a <classpath> and then I reference it from
other targets. That's OK, but what about targets like <copy>. How can
I reuse the defined <classpath>? As far as I know I cannot set a path
in the <copy> target. Unfortunately, in that case I define multiple
filesets and I use them within the <copy> target. What I could do is
to have a global <fileset> but this cannot be done regarding the
nature of the project I am involved with. There is not a starting
directory for <fileset>.

So at the end I have to update all filesets and classpaths whenever I
add or remove a library or resource :(


Do you know how I can tackle that problem? How do you avoid such kind
of redundancies? How do you keep a central point of filesets/paths?

Thank you in advance, Kostas

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


Re: How to avoid redundat path and fileset declerations

Posted by Konstantinos Karadamoglou <kk...@googlemail.com>.
Thanks Matt for your help,

Is it possible to share the way that you avoid that kind of
redundancy? What's your approach when you compose build.xml files

On 15/03/06, Matt Benson <gu...@yahoo.com> wrote:
> --- Konstantinos Karadamoglou <kk...@googlemail.com>
> wrote:
> [SNIP]
> > What I could do is
> > to have a global <fileset> but this cannot be done
> > regarding the
> > nature of the project I am involved with. There is
> > not a starting
> > directory for <fileset>.
> >
>
> This use will be covered in more than one way in Ant
> 1.7 with resource collections.  In particular there is
> a <files> collection that uses absolute paths as
> include patterns and has no base directory.  Read on
> for some help you can use now...
>
> > So at the end I have to update all filesets and
> > classpaths whenever I
> > add or remove a library or resource :(
> >
> >
> > Do you know how I can tackle that problem? How do
> > you avoid such kind
> > of redundancies? How do you keep a central point of
> > filesets/paths?
> >
> > Thank you in advance, Kostas
>
> see the id/refid construct mentioned at:
> http://ant.apache.org/manual/using.html#path
>
> This convention is available for most of Ant's built
> in "types"
> (http://ant.apache.org/manual/conceptstypeslist.html).
>
> HTH,
> Matt
>
> __________________________________________________
> 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
>
>

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


Re: How to avoid redundat path and fileset declerations

Posted by Matt Benson <gu...@yahoo.com>.
--- Konstantinos Karadamoglou <kk...@googlemail.com>
wrote:
[SNIP]
> What I could do is
> to have a global <fileset> but this cannot be done
> regarding the
> nature of the project I am involved with. There is
> not a starting
> directory for <fileset>.
> 

This use will be covered in more than one way in Ant
1.7 with resource collections.  In particular there is
a <files> collection that uses absolute paths as
include patterns and has no base directory.  Read on
for some help you can use now...

> So at the end I have to update all filesets and
> classpaths whenever I
> add or remove a library or resource :(
> 
> 
> Do you know how I can tackle that problem? How do
> you avoid such kind
> of redundancies? How do you keep a central point of
> filesets/paths?
> 
> Thank you in advance, Kostas

see the id/refid construct mentioned at:
http://ant.apache.org/manual/using.html#path

This convention is available for most of Ant's built
in "types"
(http://ant.apache.org/manual/conceptstypeslist.html).

HTH,
Matt

__________________________________________________
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