Tuesday Dec 02, 2008

ANT support in PHP projects

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?

About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today