ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florian G. Haas" <>
Subject [SUBMIT] ProjectHelp - refactored project help output
Date Sat, 08 Nov 2003 16:49:07 GMT
Hash: SHA1

Hello all.

I hereby humbly submit a new task, refactoring the way Ant describes a project 
when invoked as "ant -projecthelp". The task also introduces the option of 
autogenerating a project description from inside a build file.

* Task class name:
* Test suite:
* Modified source code outside of task definition:

Task description:

Intended as a replacement for the code in
currently in charge of generating the project description. Task reads
project description, target names, target description, and default
target. Task groups defined targets by main target, sub targets and
internal targets, and orders them alphabetically by name within these
groups. Task attempts to format project description in such a way that
lines are nicely wrapped to fit into a defined line width (if set).

Patch includes modified which uses the new
task. invokes task using default settings,
which duplicates current behavior of "ant -projecthelp"

Rationale for this task:

* There is currently no way of autogenerating a project description from
within a target in a build file. Many users duplicate the information in
their target descriptions by using a target with lots of <echo> elements,
commonly named "usage" or similar. This redundancy is unnecessary and

* The job of generating a project description is currently done by, where it clutters up the code to a considerable
extent. Putting that functionality into the ProjectHelp task and then 
executing that task from Main reduces by 130 LOC.

* The method of ordering tasks in alphabetical order by name was a
candidate for an overhaul, as it was written in a JDK1.1-compatible manner. 
With the JDK1.1 compatibility requirement dropped, it can now be implemented 
more cleanly using the SortedSet interface, available since JDK1.2.

Completed testing:

Task has been successfully compiled and tested on JDKs 1.2.2_014, 1.3.1_03, 
1.4.0_01 and 1.4.2_01 on Linux.


This is my first submission to a list I've only been lurking on for a
little while. I have tried to follow the Task Design Guidelines as
best as I could, but I would greatly appreciate any hints from more
experienced developers if I failed to follow proper procedure.

Best regards,

- -- 
Florian G. Haas <>

GnuPG key ID: 0x46D00BE3
Key fingerprint: 18B4 3E7B 191E F534 254A  1F7C 816D 950B 46D0 0BE3

My GnuPG key is available from the public PGP key server at (and various other key servers).

Version: GnuPG v1.0.7 (GNU/Linux)


View raw message