You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Erik Hatcher <er...@ehatchersolutions.com> on 2005/01/21 22:19:16 UTC
excludesfile must exist?
I haven't been in the internals of Ant for a while, my apologies. I
recall this coming up before.... any objections to changing how
<fileset> handles excludesfile (and I'm assuming includesfile) such
that existence of the file is not mandatory? Logging that the file
doesn't exist seems appropriate if we make this change. If the file
doesn't exist, it should act as if that attribute was not specified.
I'm speaking from Ant 1.6.2, and haven't looked to see if this has
changed in the latest codebase yet.
I just hit this issue in my current project where I'm trying to work
around a handful of invalid XML files with <xslt> by using
excludesfile.
Thanks,
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 25 Jan 2005, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> On Jan 25, 2005, at 5:58 AM, Stefan Bodewig wrote:
>>
>> <delete>
>> <fileset dir="extremely-important-files"
>> includesfile="some-not-so-important-files"/>
>> </delete>
>>
>> If some-not-so-important-files isn't there, Ant will barf now. I
>> guess most people prefer this over having Ant delete all files in
>> the extremely-important-files directory instead.
>
> Yes, I agree with the current behavior for includesfiles,
Just modify my example above to
<delete>
<fileset dir="mostly-boring-files"
excludesfile="some-really-important-files"/>
</delete>
and you'd prefer Ant's current behavior as well.
8-)
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 25, 2005, at 5:58 AM, Stefan Bodewig wrote:
> Actually, on second thought, there is more to this.
>
> Remember that fileset default to includes="**" and no excludes. Now
> consider
>
> <delete>
> <fileset dir="extremely-important-files"
> includesfile="some-not-so-important-files"/>
> </delete>
>
> If some-not-so-important-files isn't there, Ant will barf now. I
> guess most people prefer this over having Ant delete all files in the
> extremely-important-files directory instead.
Yes, I agree with the current behavior for includesfiles, but to my
current use the excludesfile is a different type of scenario. I want
all files included except ones that are listed in an optional file.
The <available> and <excludesfile if="..."/> works fine for me though,
so I retract my original request :)
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 24 Jan 2005, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> On Jan 24, 2005, at 3:29 AM, Stefan Bodewig wrote:
>> On Fri, 21 Jan 2005, Erik Hatcher <er...@ehatchersolutions.com>
>> wrote:
>>
>>> I haven't been in the internals of Ant for a while, my apologies.
>>> I recall this coming up before.... any objections to changing how
>>> <fileset> handles excludesfile (and I'm assuming includesfile)
>>> such that existence of the file is not mandatory?
>>
>> Your usecase is exactly why we've added if/unless to the nested
>> elements. This and the fear of breaking BWC since some builds
>> actually rely on the current behavior.
>
> Ah, the age-old BWC anchor tied around our ankles. *sigh*
Actually, on second thought, there is more to this.
Remember that fileset default to includes="**" and no excludes. Now
consider
<delete>
<fileset dir="extremely-important-files"
includesfile="some-not-so-important-files"/>
</delete>
If some-not-so-important-files isn't there, Ant will barf now. I
guess most people prefer this over having Ant delete all files in the
extremely-important-files directory instead.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 24, 2005, at 3:29 AM, Stefan Bodewig wrote:
> On Fri, 21 Jan 2005, Erik Hatcher <er...@ehatchersolutions.com> wrote:
>
>> I haven't been in the internals of Ant for a while, my apologies. I
>> recall this coming up before.... any objections to changing how
>> <fileset> handles excludesfile (and I'm assuming includesfile) such
>> that existence of the file is not mandatory?
>
> Your usecase is exactly why we've added if/unless to the nested
> elements. This and the fear of breaking BWC since some builds
> actually rely on the current behavior.
Ah, the age-old BWC anchor tied around our ankles. *sigh*
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 21 Jan 2005, Erik Hatcher <er...@ehatchersolutions.com> wrote:
> I haven't been in the internals of Ant for a while, my apologies. I
> recall this coming up before.... any objections to changing how
> <fileset> handles excludesfile (and I'm assuming includesfile) such
> that existence of the file is not mandatory?
Your usecase is exactly why we've added if/unless to the nested
elements. This and the fear of breaking BWC since some builds
actually rely on the current behavior.
I don't remember the details off-hand, but they should be available in
bugzilla.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Matt Benson <gu...@yahoo.com>.
--- Steve Loughran <st...@apache.org> wrote:
> I think it makes sense on excludesfile (as it is
> implicitly excluded),
> but not includesfile
Actually, I thought of it the other way around: if
the includes file doesn't exist, the patterns to be
contained won't be included. Maybe that's a
glass-half-empty/half-full question.
>
> On the subject of propertyfile, sometimes I wish
> there was a way of
> saying "must-exist" on a property; still, I suppose
> that is what
> macrodef is for.
>
> On the subject of macrodef, can I express my
> admiration to whoever added
> <condition> to <fail>; it makes life a lot easier...
>
I would blush but since Peter just did in response to
a comment by Antoine my doing it again so soon would
only cheapen the sentiment. But thanks! ;)
-Matt
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Steve Loughran <st...@apache.org>.
Erik Hatcher wrote:
> On Jan 21, 2005, at 4:33 PM, Matt Benson wrote:
>
>> --- Erik Hatcher <er...@ehatchersolutions.com> wrote:
>>
>>> I haven't been in the internals of Ant for a while,
>>> my apologies. I
>>> recall this coming up before.... any objections to
>>> changing how
>>> <fileset> handles excludesfile (and I'm assuming
>>> includesfile) such
>>> that existence of the file is not mandatory?
>>
>> [SNIP]
>>
>> +0 but looks like you could use available + if/unless
>> of excludesfile elements in the meantime; I hesitate
>> to presume you didn't know that, but I didn't until I
>> just looked. :)
>
>
> I hadn't thought about that option, so thanks for reminding me!
>
> It still seems silly to error on a missing includes/excludes file, sort
> of like erroring on a missing properties file with <property
> file="missing_file.properties"/>
>
I think it makes sense on excludesfile (as it is implicitly excluded),
but not includesfile
On the subject of propertyfile, sometimes I wish there was a way of
saying "must-exist" on a property; still, I suppose that is what
macrodef is for.
On the subject of macrodef, can I express my admiration to whoever added
<condition> to <fail>; it makes life a lot easier...
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 21, 2005, at 4:33 PM, Matt Benson wrote:
> --- Erik Hatcher <er...@ehatchersolutions.com> wrote:
>
>> I haven't been in the internals of Ant for a while,
>> my apologies. I
>> recall this coming up before.... any objections to
>> changing how
>> <fileset> handles excludesfile (and I'm assuming
>> includesfile) such
>> that existence of the file is not mandatory?
> [SNIP]
>
> +0 but looks like you could use available + if/unless
> of excludesfile elements in the meantime; I hesitate
> to presume you didn't know that, but I didn't until I
> just looked. :)
I hadn't thought about that option, so thanks for reminding me!
It still seems silly to error on a missing includes/excludes file, sort
of like erroring on a missing properties file with <property
file="missing_file.properties"/>
Your recommendation will suffice for my purposes though :)
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org
Re: excludesfile must exist?
Posted by Matt Benson <gu...@yahoo.com>.
--- Erik Hatcher <er...@ehatchersolutions.com> wrote:
> I haven't been in the internals of Ant for a while,
> my apologies. I
> recall this coming up before.... any objections to
> changing how
> <fileset> handles excludesfile (and I'm assuming
> includesfile) such
> that existence of the file is not mandatory?
[SNIP]
+0 but looks like you could use available + if/unless
of excludesfile elements in the meantime; I hesitate
to presume you didn't know that, but I didn't until I
just looked. :)
-Matt
__________________________________
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org