ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: include and exclude behavior
Date Thu, 01 Jan 1970 00:00:00 GMT

I was the original author of the whole include/exclude stuff. In the old days, the current
mechanism was a major enhancement, which remained backwards compatible with older versions
of Ant.

Nowadays, I would have used a mechanism in which the order is important. Something like:

include name="src/**/*"
exclude name="src/unittests/**/*"
include name="src/unittests/"

In english, include all files under src, except the files in src/unittests, but include the
file src/unittests/

This way, the file selecting mechanism is much more powerfull. The problem is that it is not
backwards compatible...

My 2 cents,

  --Arnout Kuiper

>> Well, for what I read on the discussion, they have completely misunderstood the
>> meaning "excludedefaults". The attribute is used to tell if things that are always

>> excluded (no matter what you say) apply or not. The list of things that are always

>> excluded can be found in the docs.
>I see now that you're right about defaultexcludes.  It would be nice to specify a default
action, or the order for the actions (similar to the "Order allow, deny" config setting for
>> Now, looking at the real issue: how to say "exclude all BAR except the one under

>> FOO (FOO/BAR)", I think the way to solve this is by allowing multiple <filepattern>

>> elements and for those patterns to act independent of one another (to a certain 
>> extend). 
>> Can we do something like this already? I do not think so, but....
>Actually, the snippet Jose included was pretty much the same solution Peter 
>suggested on the ant-user list.  And it worked - so I guess Ant treats patterns in 
>multiple filesets as independent of each other.  Yea, Ant!

View raw message