Ticket #306 (closed enhancement: fixed)
Command-line option to output the <target> description attribute text
| Reported by: | anonymous | Owned by: | mrook |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.4.0RC1 |
| Component: | phing-core | Version: | 2.2.0 |
| Keywords: | Cc: |
Description
For people that like to use short numbered <target> names, would it be possible for Phing to output the value of each <target> description attribute, after the <target> name as the phing build file is executed?
This would allow developers that use long <target> names to continue using these long names.
* For developers that want to use short <target> names, such as t1, t2, tn, there could be a Phing command-line option to enable the displaying of the <target> description attribute value on the command-line, after the <target> name is displayed, as the build file runs.
This would allow developers to use the description attribute value in the output of a running phing script.
When a <target> is moved around in the source file, the target depends="tnn" attribute values would only have to be renumbered, as opposed to renaming them with long hard-to-remember names.
The description attribute value for the <target> would remain constant and not need to be changed, as it will still describe the target's function.
Example:
<?xml version="1.0"?>
<project name="DescriptionAttrib" default="finished" basedir=".">
<target name="t1" description="First Target">
<echo>In Target t1</echo>
</target>
<target name="t2" depends="t1" description="Second Target">
<echo>In Target t2</echo>
</target>
<target name="t3" depends="t2" description="Third Target">
<echo>In Target t3</echo>
</target>
<target name="finished" depends="t3" description="Last Target">
<echo>In Target finished</echo>
</target>
</project>
As Phing is now, the above script will produce the following output:
[root]# phing -f descript.xml
Buildfile: /test/PHING/general/descript.xml
DescriptionAttrib > t1:
[echo] In Target t1
DescriptionAttrib > t2:
[echo] In Target t2
DescriptionAttrib > t3:
[echo] In Target t3
DescriptionAttrib > finished:
[echo] In Target finished
BUILD FINISHED
Total time: 0.4220 seconds
Would it be possible for Phing to use a command-line option, to output the value of the description attribute, like:
[root]# phing -D -f descript.xml
Buildfile: /test/PHING/general/descript.xml
DescriptionAttrib > t1: > First Target
[echo] In Target t1
DescriptionAttrib > t2: > Second Target
[echo] In Target t2
DescriptionAttrib > t3: > Third Target
[echo] In Target t3
DescriptionAttrib > finished: > Last Target
[echo] In Target finished
BUILD FINISHED
Total time: 0.4220 seconds
