You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Donald <do...@apache.org> on 2001/07/18 11:53:43 UTC

[ant2] SQL-like includes

Hi,

I was just talking with someone about the prospect of filesets with 
cullers/filters etc and they pointed out n interesting thing. This same 
problem was "solved" in SQL years ago. ie imagine the following is psuedo 
antified sql. This would allow us to perform all the complex things that 
people have asked for but simply. 

Select */*.java from src/java where readable == true 

So you would have 

Select NAME-PATTERN from BASE-DIRECTORY where CONDITIONS

In ant1 out filesets already have the capability of representing
Select NAME-PATTERN from BASE-DIRECTORY. It would be simple to extend this 
with a where clause. As a consequence of looking at this way I thought it 
could be represented fairly easily by a minor change such as

<include name="**/*.java">
  <condition test="..." />
  <condition test="..." />
  <condition test="..." />
</include>

Thoughts?

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: [ant2] SQL-like includes

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 19 Jul 2001, Peter Donald <do...@apache.org> wrote:

> I know - but that method was rejected in our last vote so I was
> trying to work around that ... ;)

Uhm?

Are you referring to

>> * Allow mappers to be genericised so that particular features can
>>   be modified during mapping.
>> 
>> [REJECTED - vetoes by Stefan Bodewig and Conor MacNeill, not enough
>>             positive votes anyway.]

Reason (at least mine) - this is not the purpose of mappers, let's use
a different mechanism.

We also have

>> * Allow include/exclude tow work with multiple characteristerics of a file.
>>
>> [ACCEPTED]

with the condition by Conor that the old <include name="..." /> should
remain as a shortcut.

Looks as if it has been accepted.

Stefan

Re: [ant2] SQL-like includes

Posted by Peter Donald <do...@apache.org>.
On Thu, 19 Jul 2001 16:22, Stefan Bodewig wrote:
> On Wed, 18 Jul 2001, Peter Donald <do...@apache.org> wrote:
> > This same problem was "solved" in SQL years ago. ie imagine the
> > following is psuedo antified sql.
> >
> > Select */*.java from src/java where readable == true
>
> Not quite, as you don't really specify a pattern in SQL, it would
> rather be
>
> Select * from src/java where filename matches '*/*.java' and readable ==
> true
>
> Matching a pattern is just another condition for the where clause.
> Your approach would be the easiest to integrate with the way filesets
> work right now, but we should at least think about extending it a bit
> further so that name="..." is just a condition as well.

I know - but that method was rejected in our last vote so I was trying to 
work around that ... ;)

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: [ant2] SQL-like includes

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 18 Jul 2001, Peter Donald <do...@apache.org> wrote:

> This same problem was "solved" in SQL years ago. ie imagine the
> following is psuedo antified sql.
> 
> Select */*.java from src/java where readable == true 
> 

Not quite, as you don't really specify a pattern in SQL, it would
rather be 

Select * from src/java where filename matches '*/*.java' and readable == true 

Matching a pattern is just another condition for the where clause.
Your approach would be the easiest to integrate with the way filesets
work right now, but we should at least think about extending it a bit
further so that name="..." is just a condition as well.

Stefan

Re: [ant2] SQL-like includes

Posted by Peter Donald <do...@apache.org>.
On Thu, 19 Jul 2001 06:34, John.Casey wrote:
> This would be a beautiful feature to have. It adds so
> much power without adding much complexity.
>
> How would you handle the vocabulary of the test
> attribute of condition? Would you allow extensions of
> conditions, or what?

Well I was thinking that any Condition would just have to implement an 
interface (say interface ItemTest {}) and they could automatically be used. 
So if you needed another test you just write a 

class Foo implements ItemTest {}

then register it as "foo" and then you could use the foo test ;)

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: [ant2] SQL-like includes

Posted by "John.Casey" <jd...@yahoo.com>.
This would be a beautiful feature to have. It adds so
much power without adding much complexity.

How would you handle the vocabulary of the test
attribute of condition? Would you allow extensions of
conditions, or what?

John

--- Peter Donald <do...@apache.org> wrote:
> Hi,
> 
> I was just talking with someone about the prospect
> of filesets with 
> cullers/filters etc and they pointed out n
> interesting thing. This same 
> problem was "solved" in SQL years ago. ie imagine
> the following is psuedo 
> antified sql. This would allow us to perform all the
> complex things that 
> people have asked for but simply. 
> 
> Select */*.java from src/java where readable == true
> 
> 
> So you would have 
> 
> Select NAME-PATTERN from BASE-DIRECTORY where
> CONDITIONS
> 
> In ant1 out filesets already have the capability of
> representing
> Select NAME-PATTERN from BASE-DIRECTORY. It would be
> simple to extend this 
> with a where clause. As a consequence of looking at
> this way I thought it 
> could be represented fairly easily by a minor change
> such as
> 
> <include name="**/*.java">
>   <condition test="..." />
>   <condition test="..." />
>   <condition test="..." />
> </include>
> 
> Thoughts?
> 
> 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             
>  |
>
*-----------------------------------------------------*


=====
John Casey

jdcasey@digitalsymbiosis.net
Omni CodeWorks, Inc.

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