http://codereview.appspot.com/153054/diff/1003/5 File src/com/google/caja/tools/AbstractCajaAntTask.java (right): http://codereview.appspot.com/153054/diff/1003/5#newcode238 src/com/google/caja/tools/AbstractCajaAntTask.java:238: List<File> getFiles() { this is going to put all ...
16 years, 7 months ago
(2009-11-11 21:13:57 UTC)
#2
http://codereview.appspot.com/153054/diff/1003/5
File src/com/google/caja/tools/AbstractCajaAntTask.java (right):
http://codereview.appspot.com/153054/diff/1003/5#newcode238
src/com/google/caja/tools/AbstractCajaAntTask.java:238: List<File> getFiles() {
this is going to put all <file>s before all <fileset>s
so it's going to be hard to do something like
<file file="header"/>
<fileset>...</fileset>
<file file="footer"/>
I think you need to expand the fileset at the time it's declared.
http://codereview.appspot.com/153054/diff/1003/5#newcode244
src/com/google/caja/tools/AbstractCajaAntTask.java:244: // TODO(mikesamuel):
impose some ordering within a group
how about always sort the results by name?
sorting was the main reason I got lost when trying to do this earlier.
filesets are normally unordered, and the way to order them
is to enclose them in a <sort>, which means dealing with
ant's resource collections, not just the "legacy" filesets.
but for this use, I don't think there's a reason to do
anything other than sort by name.
16 years, 7 months ago
(2009-11-11 21:27:10 UTC)
#3
http://codereview.appspot.com/153054/diff/1003/5
File src/com/google/caja/tools/AbstractCajaAntTask.java (right):
http://codereview.appspot.com/153054/diff/1003/5#newcode238
src/com/google/caja/tools/AbstractCajaAntTask.java:238: List<File> getFiles() {
On 2009/11/11 21:13:57, felix8a wrote:
>
> this is going to put all <file>s before all <fileset>s
> so it's going to be hard to do something like
> <file file="header"/>
> <fileset>...</fileset>
> <file file="footer"/>
I think
<include file=".../header.html"/>
<include>
<fileset dir="...">
<include name="*.html"/>
<exclude name="header.html"/>
<exclude name="footer.html"/>
</fileset>
</include>
<include file=".../footer.html"/>
should do it.
Now that I think about it, having <include> nesting with different
meaning probably is confusing so I should probably rename <include> to
<input> to be symmetric with <output>.
> I think you need to expand the fileset at the time it's declared.
Ant doesn't work that way. It calls the create method to create an object based
on a tag, and then fills it with recursive calls to create* methods and set*
methods based on inner tags and attributes respectively.
http://codereview.appspot.com/153054/diff/1003/5#newcode244
src/com/google/caja/tools/AbstractCajaAntTask.java:244: // TODO(mikesamuel):
impose some ordering within a group
On 2009/11/11 21:13:57, felix8a wrote:
> how about always sort the results by name?
will do.
> sorting was the main reason I got lost when trying to do this earlier.
> filesets are normally unordered, and the way to order them
> is to enclose them in a <sort>, which means dealing with
> ant's resource collections, not just the "legacy" filesets.
>
> but for this use, I don't think there's a reason to do
> anything other than sort by name.
16 years, 7 months ago
(2009-11-11 21:47:25 UTC)
#4
On 2009/11/11 21:27:10, MikeSamuel wrote:
> http://codereview.appspot.com/153054/diff/1003/5
> File src/com/google/caja/tools/AbstractCajaAntTask.java (right):
>
> http://codereview.appspot.com/153054/diff/1003/5#newcode238
> src/com/google/caja/tools/AbstractCajaAntTask.java:238: List<File> getFiles()
{
> On 2009/11/11 21:13:57, felix8a wrote:
> >
> > this is going to put all <file>s before all <fileset>s
> > so it's going to be hard to do something like
> > <file file="header"/>
> > <fileset>...</fileset>
> > <file file="footer"/>
>
> I think
> <include file=".../header.html"/>
> <include>
> <fileset dir="...">
> <include name="*.html"/>
> <exclude name="header.html"/>
> <exclude name="footer.html"/>
> </fileset>
> </include>
> <include file=".../footer.html"/>
> should do it.
ah, ok.
> Now that I think about it, having <include> nesting with different
> meaning probably is confusing so I should probably rename <include> to
> <input> to be symmetric with <output>.
ok.
> > I think you need to expand the fileset at the time it's declared.
>
> Ant doesn't work that way. It calls the create method to create an object
based
> on a tag, and then fills it with recursive calls to create* methods and set*
> methods based on inner tags and attributes respectively.
I thought you could use an addConfiguredFoo method to catch a directive after
it's been constructed rather than before?
On 2009/11/11 21:47:25, felix8a wrote: > On 2009/11/11 21:27:10, MikeSamuel wrote: > > http://codereview.appspot.com/153054/diff/1003/5 > ...
16 years, 7 months ago
(2009-11-11 21:53:15 UTC)
#5
On 2009/11/11 21:47:25, felix8a wrote:
> On 2009/11/11 21:27:10, MikeSamuel wrote:
> > http://codereview.appspot.com/153054/diff/1003/5
> > File src/com/google/caja/tools/AbstractCajaAntTask.java (right):
> >
> > http://codereview.appspot.com/153054/diff/1003/5#newcode238
> > src/com/google/caja/tools/AbstractCajaAntTask.java:238: List<File>
getFiles()
> {
> > On 2009/11/11 21:13:57, felix8a wrote:
> > >
> > > this is going to put all <file>s before all <fileset>s
> > > so it's going to be hard to do something like
> > > <file file="header"/>
> > > <fileset>...</fileset>
> > > <file file="footer"/>
> >
> > I think
> > <include file=".../header.html"/>
> > <include>
> > <fileset dir="...">
> > <include name="*.html"/>
> > <exclude name="header.html"/>
> > <exclude name="footer.html"/>
> > </fileset>
> > </include>
> > <include file=".../footer.html"/>
> > should do it.
>
> ah, ok.
>
> > Now that I think about it, having <include> nesting with different
> > meaning probably is confusing so I should probably rename <include> to
> > <input> to be symmetric with <output>.
>
> ok.
>
> > > I think you need to expand the fileset at the time it's declared.
> >
> > Ant doesn't work that way. It calls the create method to create an object
> based
> > on a tag, and then fills it with recursive calls to create* methods and set*
> > methods based on inner tags and attributes respectively.
>
> I thought you could use an addConfiguredFoo method to catch a directive after
> it's been constructed rather than before?
I didn't know that. http://ant.apache.org/manual/develop.html#nested-elements
agrees with you. Would you like me to rework it to use that?
Issue 153054: Change AbstractCajaAntTask to allow use of <filesets> inside <include>/<depend>
(Closed)
Created 16 years, 7 months ago by MikeSamuel
Modified 16 years, 7 months ago
Reviewers: felix8a
Base URL: http://google-caja.googlecode.com/svn/trunk/
Comments: 4