On Feb 27, 2005, at 10:12 AM, Drew Davidson wrote:
Erik Hatcher wrote:

On Feb 27, 2005, at 9:28 AM, Drew Davidson wrote:

I have an ant task that writes a property file based on a prefix.


For a frequent basher of Ant, it might behoove you to know the enemy well:

<project name="propfile">
<property name="hibernate.whatever" value="Drew"/>
<echoproperties destfile="hibernate.properties" prefix="hibernate."/>
</project>


True that this misses the original point, as does your task, of keeping the comments intact. <echoproperties> also supports the <propertyset>'s, which allow lots of control over which properties are selected, not just by prefix.

Great, just try to find it in

http://ant.apache.org/manual/index.html

Well, I clicked on the "Overview of Ant Tasks" link to get to this page:

        http://ant.apache.org/manual/tasksoverview.html

and there is a "property tasks" area.  Echoproperties is listed there.

I'm not going to defend Ant's documentation structure - I agree its horrible. For the Ant book I spent a great deal of time building an XDoclet task reference generator (it's in Ant's proposal/xdocs CVS directory). Appendix E of our book was entirely generated. In that effort, I meticulously annotated Ant's task source code with @tags to provide the necessary metadata that could not be gleaned otherwise. That effort in no way fixed the structure of the documentation.

Oh, it's in "Optional Tasks": what does that mean? Only with the ant optional jar? How do I know someone will have that who tries to use my build file? Why is it optional? Which Ant developer made the arbitrary decision that this "echoproperties" gem should be "optional" instead of "core"?

All of these questions have been discussed in the Ant e-mail list. The short answer is that in Ant 1.6+, all "optional" stuff is included in Ant by default - nothing needs to be added unless there are 3rd party dependencies (junit.jar, for example) that don't ship with Ant but are used by some tasks.


The documentation is IMPOSSIBLE TO NAVIGATE. I wish that I'd saved myself the time and effort to write this because Ant's documentation was written and organized by a 4 year old. Thanks for making me angrier.

I personally feel guilty and responsible for the state of Ant's documentation. The info is actually there, it needs someone with a keen sense of how to structure it better though.


I know these rhetorical comments will strike more nerves, but did you ask on the Ant list (or this list?) if there was a way to write property files from all Ant properties? Did you consider contributing your task to Ant itself since it is generic and not tied to OGNL itself? Can't we be one big happy family and get along? :)

As to "For a frequent basher of Ant, it might behoove you to know the enemy well" I really don't want to have to grovel through a big, unorganized heap of incredibly badly written documentation to find this. The fact that I didn't find this (and I was looking) and Chad didn't find it might make you think that maybe it's the fault of the lousy documentation, not the searcher. The docs are all just a big bag of stuff with no organizations or explainations. How the hell am I supposed to know to look in "Optional Tasks" instead of "Core Tasks"???

No argument there... it's a mess. The point of the overview of tasks page was to build a bit more structure to it, though it is quite inadequate. We used to have an Ant committer on board that worked on keeping documentation up to date and started this restructuring, but unfortunately she's no longer active.


        Erik


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to