ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: [PATCH] ant task with (nested) fileset(s)
Date Fri, 09 Nov 2001 11:04:19 GMT
From: "Holger Engels" <hengels@mercatis.de>

> 
> I just implemented ant as a matching task with support for nested 
> filesets. Assuming, that the current directory contains sub1.xml and 
> sub2.xml, the following three blocks have the same effect:
> 
>     <ant target="main">
>       <include name="sub*"/>
>     </ant>
> 
> 
>     <ant target="main">
>       <fileset dir=".">
>         <include name="sub1.xml"/>
>       </fileset>
>     </ant>
> 
> 
>     <ant antfile="sub1.xml" target="main"/>
>     <ant antfile="sub2.xml" target="main"/>
> 
> 'dir' acts as the basedir for the matching task's fileset, if 
> (in|ex)cludes(file)? has been provided. 'antfile' or it's default 
> "build.xml" are added to the matching tasks includes if no other includes 
> / excludes have been specified and no nested filesets do exist.
> 

I have a problem with using "dir" in this way. The reason is that "dir"
means "set basedir to this value". Which I doubt is the correct interpretation
it the buildfiles are more than one level down.

<ant dir="sub" target="xx">
    <include name="sub1/**/build.xml" />
</ant>

with which value for basedir will this tasks be running. I doubt "sub"
is the correct value for all of them. But that is the current meaning of "dir".

I think it is best not making the task extend from MatchingTask but
still support <fileset> elements or as I call it <antfileset> :-)

<ant target="xx">
    <fileset dir="sub">
        <include name="sub1/**/build.xml" />
    </fileset>
</ant>

here the different meanings of dir are kept appart. And in this particular case
you will be using the "basedir" defined in the sub-buildfiles. If you use
<ant dir="xyz"> then it should mean use this value for "basedir", as it does today.

Jose Alberto



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message