ANT support in PHP projects
By Petr on Dec 02, 2008
A build tool can be used for automated actions. For example if you want to have continual build and run tests, building documentations, create a production builds, deploy on a staging or production server etc. One of such build tools is Apache Ant, which is a Java-based build tool. You can use this tool also together with your PHP projects. The NetBeans PHP distribution is probably only one distribution, which doesn't contain the Ant support by default.
Adding Ant into the IDE is very simple. Open the plugin manager (Tools->Plugins) and on the Available Plugins tab in the Search dialog write ant. After this, you should see similar picture to:
Check the Ant item and click on Install button. After accepting the license, the needed module are downloaded from the update center and installed. If you have already an ant file in your project it should be after the installation recognized.
Although the Ant files are xml files, they have a special icon in NetBeans. You can expand the node that represents the Ant file in explorer and the subnodes are the targets defined in the script. You can run single target and also you can assign a shortcut for a target through the context menu over the target node.
The editor offers code completion for Ant tags and also for their attributes. You can also validate and check whether the file is well formed.
There is one limitation in PHP distribution. The PHP project doesn't allow to create Ant files through a wizard. So you have to create new well-formed xml document. The root element has to be <project>.
Does someone from readers use Ant together with PHP projects? Do you use a building tool? Which one?