10

i have about 25 phing targets, when i list them in the console.

But 5 of them are just needed by other targets and i will never trigger them alone.

is there a possibility to hide them?

For example:

There are the targets: cms.cc cc-config cc-content cc-service

The all pop up in my list, but "cc"-target is the only one i will trigger.

Thank you!

OskarStark
  • 384
  • 1
  • 11

3 Answers3

8

I didn't test it myself, but according a testcase I found via Google I guess, that there is a (not documented) attribute hidden

<target hidden="true" />
KingCrunch
  • 128,817
  • 21
  • 151
  • 173
  • hi, it doesn't work for me. BUILD FAILED Error reading project file [wrapped: /srv/htdocs/trunk/applications/fe/etc/build.xml:21:113: Unexpected attribute 'hidden'] Total time: 0.0630 seconds – OskarStark Oct 26 '11 at 12:58
  • 1
    phing 2.5 could solve this problem i thnk. your attribute is written here: http://www.phing.info/trac/browser/branches/2.5/test/etc/components/Target/HiddenTargets.xml?rev=1013&order=size – OskarStark Oct 26 '11 at 13:07
2

Using the suggested target attribute hidden with them values true|false while hide them from phing -l since Phing version 2.4.3.

raphaelstolt
  • 1,962
  • 1
  • 13
  • 7
1

There's attribute hidden for targets. It was documented starting from version 2.4.13.

It's well described in the section H.2 Targets and subsection H.2.2 Attributes:

hidden | Boolean | Whether or not to include this target in the list of targets generated by phing -l | Default: False | Required: No

Currently available arguments are well documented as well in A.2 Command Line Arguments section:

-l -list

List all available targets in buildfile (excluding targets that have their hidden attribute set to true)

Example of usage is next:

<target name="project-target" description="meaningful description" hidden="true">
    ...
</target>
Farside
  • 9,923
  • 4
  • 47
  • 60