Modify

Ticket #306 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

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

Attachments

Change History

comment:1 Changed 3 years ago by mrook

  • Owner changed from hans to mrook
  • Status changed from new to assigned
  • Milestone set to 2.4.0

comment:2 Changed 2 years ago by mrook

(In [514]) Refs #306 - Command-line option to output the <target> description attribute text: Phing now allows -longtarget command line option

comment:3 Changed 2 years ago by mrook

  • Status changed from assigned to closed
  • Resolution set to fixed

This bug has been fixed in the SVN tree, revision r514.

Thank you for the report, and for helping us make Phing better!

View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.