Last Updated: February 25, 2016
·
1.256K
· vimishor

Hide a Phing target

I usually split my Phing build file in main targets and sub targets (aka dependencies). For example, a main target can be css.build which will concatenate and minify all my CSS files and this will depend of a few sub targets, like css.concatenate and css.minify.

To keep the output of phing -list as clean as possible, I will hide those two dependencies by adding hidden attribute.

<target name="css.build">
    <!-- more code -->
</target>
<target name="css.concatenate" hidden="true">
    <!-- more code -->
</target>
<target name="css.minify" hidden="true">
    <!-- more code -->
</target>

This way only css.build will be included in the output of phing -list.

2 Responses
Add your response

The tasks might be hidden but are still callable, to prevent this you can prefix them with a hyphen. Also using dots in task names might clash with the convention for using them for naming build file properties.

over 1 year ago ·

Yes the tasks are still callable, because I just needed to hide them. Occasionally I might need to call them directly. Thanks for your additions!

Best regards.

over 1 year ago ·