Make a Phing task private (non-executable)
For tasks which should never be called directly via the Phing Cli use the following trick to make a task private or non-executable.
<?xml version="1.0" encoding="UTF-8"?>
<project name="example-project" default="build">
<target name="build" depends="-non-executable">
<echo msg="Build" />
</target>
<target name="-non-executable">
<echo msg="Non executable" />
</target>
</project>
This way the -non-executable
task will never be callable via the Phing Cli but still be available for orchestration within the build file.
$ phing -non-executable
Unknown argument: -non-executable
phing [options] [target [target2 [target3] ...]]
Options:
-h -help print this message
-l -list list available targets in this project
....
Report bugs to <dev@phing.tigris.org>
PS: This also works for ANT.
Written by Raphael Stolt
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#