ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject Re: [SUBMIT] FileOrder element for ordering of filesets
Date Wed, 10 Apr 2002 00:31:22 GMT

----- Original Message -----
From: "Rob Oxspring" <>
To: "Ant Developers List" <>
Sent: Tuesday, April 09, 2002 3:57 PM
Subject: [SUBMIT] FileOrder element for ordering of filesets

> Background:
> IIRC at least one of the problems with submitted concatenation tasks in
> past was that ant does not guarentee the order of files within the
> concatenated file.  Instead of patching one of the concat tasks
> where I started) this submission is just a utility to allow file order to
> specified by the user and applied by the task. I'm sure this is useful for
> concatenation, it may also be handy for the tar/zip family of tasks and it
> might also add an extra aesthetic bonus to the mail task.
> User perspective:
> The idea is that tasks can be enhanced with a fileorder element that takes
> an order attribute defining the order to be used when processing files.
> Implementation using an attribute would involve creating an implicit
> fileorder object to hold the value.  Various attributes of a file can be
> used to specify the order, can be reversed with a '-' prefix, and combined
> with ',' symbols.  Currently the supported attributes are
> name|basename|extension|path|size|length|date.
> E.g.
> <fileorder order="path,extension,basename"/> - group by directory and then
> file extension
> <fileorder order="-date"/> - decreasing date order

ok, to be an XML pedant we should really have somethign verbose like

 <sort="date" direction="descending"/>
 <sort="size" direction="ascending"/>
 <sort="org.someone.newsort" direction="ascending"/>

I know it is harder to use, but it is better than encoding magic in literals
and makes XSLT rework that much easier.

> How it works:
> The Java2 Comparator is reimplemented and various implementations are used
> to supply the ordering information.  A merge sort is performed by the
> method, thus avoiding the Java2 dependancies of Collections.sort() or
> Arrays.sort().  These should probably be revised when the move to Java2 is
> made.

So it works on java1.1 fine? Nice.

> Whats included:
> o.a.t.a.util.FileOrder - the class doing the work.
>* - the classes doing the comparisons
> o.a.t.a.util.FileOrderTest - tests the attribute validation and general
> sorting
> - tests each comparator individually

> So, anyone think that this is useful? is it worth me writing the docs?

I think this is a nice feature, +1 on sticking it in the system with the
appopriate docs and tests, though I am minded towards a more rigorous
approach because it is more xml-ish, and may give more flexibilityin future.

Which apps should have it? Mail, clearly; but which others? Concat?

What do others think?


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message