You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jon Eaves <jo...@eaves.org> on 2001/06/22 10:30:51 UTC

*Warning* to all using

Hi all,

I've just spent a relatively frustrating day trying to work out
why the hell my <tar> was ignoring my <patternset> <exclude>.

It turns out that my file looked like this:

<patternset id="lw.excludes" >
  <exclude name="**/javax/**" />
</patternset>

In my <javac>

<javac srcdir="${master.src}" 
  destdir="${master.classes}" >
  <patternset id="lw.excludes" /> 
  <classpath refid = "compile.cp" />
</javac>

And my <tar>

<tar tarfile="${master.dist}/lcrypto-${master.tarfile}.tar" >
  <tarfileset dir="${master.home}/" >
   <patternset refid="lw.tar" /> 
   <patternset refid="lw.excludes" /> 
   <patternset refid="tar.extras" /> 
  </tarfileset>
</tar>

Now all the people here are going to point out that this is
because I've redefined <patternset> in the <javac>.  However,
that wasn't all that obvious.  The <javac> task should be

<patternset refid="lw.excludes" /> 

A subtle but important distinction. ;-)  This applies to 
pretty much anything that can be 'id' and then 'refid'
later on.

A "'refid' used where 'id' expected" type warning would be
really, really nice.

Cheers,
    -- jon

--
Jon Eaves <jo...@eaves.org>
http://www.eaves.org/jon/


Re: *Warning* to all using

Posted by Diane Holt <ho...@yahoo.com>.
--- Peter Donald <do...@apache.org> wrote:
> > I suspect with the number of newbies using Ant
> > that these sorts of "protect the user" capabilities
> > will become more requirements if Ant is to be
> > adopted in a wider audience.
> 
> Currently most of the vocal people want the "protect the user" 
> capabilities to be removed ;(

I don't think anyone's against issuing warnings about things -- they're
just against not allowing for functionality that they know how to use
correctly just because other people might not.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Re: *Warning* to all using

Posted by Peter Donald <do...@apache.org>.
On Sat, 23 Jun 2001 11:59, Jon Eaves wrote:
> Happy to have any sort of message telling me
> I'm doing a potentially dumb thing.  I do it
> frequently enough ! ;-)

me too ;)

> I suspect with the number of newbies using Ant
> that these sorts of "protect the user" capabilities
> will become more requirements if Ant is to be
> adopted in a wider audience.

Currently most of the vocal people want the "protect the user" 
capabilities to be removed ;(

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*

Re: *Warning* to all using

Posted by Jon Eaves <jo...@eaves.org>.
Hi all,

The sort of behaviour I'm looking for is
when using perl and invoke the "use strict" 
directive.

It shows where you are doing dangerous things.

Happy to have any sort of message telling me
I'm doing a potentially dumb thing.  I do it
frequently enough ! ;-)

I suspect with the number of newbies using Ant
that these sorts of "protect the user" capabilities
will become more requirements if Ant is to be
adopted in a wider audience.

Cheers,
    -- jon

----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Friday, June 22, 2001 7:11 PM
Subject: Re: *Warning* to all using <patternset>


> Jon Eaves <jo...@eaves.org> wrote:
> 
> > A "'refid' used where 'id' expected" type warning would be
> > really, really nice.
> 
> Things are not that easy - as it is perfectly valid to use the id
> attribute on a patternset that you define within a task.
> 
> How about a message whenever one replaces an existing reference?
> Wouldn't break backwards compatibility either.
> 
> Stefan
> 


Re: *Warning* to all using

Posted by Stefan Bodewig <bo...@apache.org>.
Jon Eaves <jo...@eaves.org> wrote:

> A "'refid' used where 'id' expected" type warning would be
> really, really nice.

Things are not that easy - as it is perfectly valid to use the id
attribute on a patternset that you define within a task.

How about a message whenever one replaces an existing reference?
Wouldn't break backwards compatibility either.

Stefan

Re: *Warning* to all using

Posted by Stefan Bodewig <bo...@apache.org>.
Jerome Lacoste <je...@smartcardsystem.com> wrote:

> But in that case, you define your path outside the place it is used,
> am I right?

Yes.

Stefan

RE: *Warning* to all using

Posted by Jerome Lacoste <je...@smartcardsystem.com>.
> Jirtme Lacoste <je...@smartcardsystem.com> wrote:
>
> > Defining an new patternset, with no argument (except the id) seems a
> > little bit strange to me. What can it be used for? It bring nothing
> > to the build file.
>
> I've done so with path's more than once - I think Ant's own build file
> still does.
>
> The idea here is to have an entry point for stuff I want to add to the
> classpath for certain tasks when I anticipate that I want to do this
> sometime.

Ok, if I understand, it is like defining a new type, to ease implementation
of changes.

But in that case, you define your path outside the place it is used, am I
right?

So if I reformulate, defining a new patternset, within a task, with no
argument (except the id) seems a little bit strange to me. A warning could
be added for these cases.

But I am sure someone would also find an usage for this. Anyway, it now
seems too much work to implement that warning for that specific case. So
perhaps naming convention should solve most of the mistakes.

Jerome



Re: *Warning* to all using

Posted by Stefan Bodewig <bo...@apache.org>.
Jirtme Lacoste <je...@smartcardsystem.com> wrote:

> Defining an new patternset, with no argument (except the id) seems a
> little bit strange to me. What can it be used for? It bring nothing
> to the build file.

I've done so with path's more than once - I think Ant's own build file
still does.

The idea here is to have an entry point for stuff I want to add to the
classpath for certain tasks when I anticipate that I want to do this
sometime.

Stefan

RE: *Warning* to all using

Posted by Jérôme Lacoste <je...@smartcardsystem.com>.
Naming conventions seems good.

I would also like to point out that when someone wants to use a reference to
a patternset, he is using an empty patternset declaration, but one that
wants to create one defines it with arguments.
So a warning in the case one uses an empty patternset but uses 'id' seems OK
to me, but it is perhaps difficult to detect that case.

Defining an new patternset, with no argument (except the id) seems a little
bit strange to me. What can it be used for? It bring nothing to the build
file.

Jerom


> -----Original Message-----
> From: Peter Donald [mailto:donaldp@apache.org]
> Sent: Friday, June 22, 2001 10:31 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: *Warning* to all using <patternset>
>
>
> In Ant1 I am not sure we can do this (we need backwards
> compatibility). In
> Ant2 we will be following the same pattern as properties (because
> datatypes
> are effectively just another form of property in ant2). So if we
> decide for
> immutability then we will throw an exception, if we allow
> mutability then it
> will be silently ignored. There may be something better we can do
> to avoid
> this (I am thinking of better naming conventions or something) in ant2?
> Suggestions?
>
> On Fri, 22 Jun 2001 18:30, Jon Eaves wrote:
> > Hi all,
> >
> > I've just spent a relatively frustrating day trying to work out
> > why the hell my <tar> was ignoring my <patternset> <exclude>.
> >
> > It turns out that my file looked like this:
> >
> > <patternset id="lw.excludes" >
> >   <exclude name="**/javax/**" />
> > </patternset>
> >
> > In my <javac>
> >
> > <javac srcdir="${master.src}"
> >   destdir="${master.classes}" >
> >   <patternset id="lw.excludes" />
> >   <classpath refid = "compile.cp" />
> > </javac>
> >
> > And my <tar>
> >
> > <tar tarfile="${master.dist}/lcrypto-${master.tarfile}.tar" >
> >   <tarfileset dir="${master.home}/" >
> >    <patternset refid="lw.tar" />
> >    <patternset refid="lw.excludes" />
> >    <patternset refid="tar.extras" />
> >   </tarfileset>
> > </tar>
> >
> > Now all the people here are going to point out that this is
> > because I've redefined <patternset> in the <javac>.  However,
> > that wasn't all that obvious.  The <javac> task should be
> >
> > <patternset refid="lw.excludes" />
> >
> > A subtle but important distinction. ;-)  This applies to
> > pretty much anything that can be 'id' and then 'refid'
> > later on.
> >
> > A "'refid' used where 'id' expected" type warning would be
> > really, really nice.
> >
> > Cheers,
> >     -- jon
> >
> > --
> > Jon Eaves <jo...@eaves.org>
> > http://www.eaves.org/jon/
>
> --
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof."                   |
> |              - John Kenneth Galbraith               |
> *-----------------------------------------------------*


Re: *Warning* to all using

Posted by Peter Donald <do...@apache.org>.
In Ant1 I am not sure we can do this (we need backwards compatibility). In 
Ant2 we will be following the same pattern as properties (because datatypes 
are effectively just another form of property in ant2). So if we decide for 
immutability then we will throw an exception, if we allow mutability then it 
will be silently ignored. There may be something better we can do to avoid 
this (I am thinking of better naming conventions or something) in ant2? 
Suggestions?

On Fri, 22 Jun 2001 18:30, Jon Eaves wrote:
> Hi all,
>
> I've just spent a relatively frustrating day trying to work out
> why the hell my <tar> was ignoring my <patternset> <exclude>.
>
> It turns out that my file looked like this:
>
> <patternset id="lw.excludes" >
>   <exclude name="**/javax/**" />
> </patternset>
>
> In my <javac>
>
> <javac srcdir="${master.src}"
>   destdir="${master.classes}" >
>   <patternset id="lw.excludes" />
>   <classpath refid = "compile.cp" />
> </javac>
>
> And my <tar>
>
> <tar tarfile="${master.dist}/lcrypto-${master.tarfile}.tar" >
>   <tarfileset dir="${master.home}/" >
>    <patternset refid="lw.tar" />
>    <patternset refid="lw.excludes" />
>    <patternset refid="tar.extras" />
>   </tarfileset>
> </tar>
>
> Now all the people here are going to point out that this is
> because I've redefined <patternset> in the <javac>.  However,
> that wasn't all that obvious.  The <javac> task should be
>
> <patternset refid="lw.excludes" />
>
> A subtle but important distinction. ;-)  This applies to
> pretty much anything that can be 'id' and then 'refid'
> later on.
>
> A "'refid' used where 'id' expected" type warning would be
> really, really nice.
>
> Cheers,
>     -- jon
>
> --
> Jon Eaves <jo...@eaves.org>
> http://www.eaves.org/jon/

-- 
Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*