Skip to main content

Building Phobos

Building a Phobos distribution

In order to build Phobos, you need JDK 1.5.0 or above and a recent version of Apache Ant (we use 1.6.3).

Phobos depends on jMaki for its AJAX functionality. So first of all you need to check out and build jMaki. It boils down to the following:

cvs -d :pserver:<<your_java_net_id>>@cvs.dev.java.net:/cvs checkout ajax
cd ajax/ws/jmaki
ant

Then go back to the directory you issued the cvs command in, check out the sources for Phobos from CVS and build the project. In detail:

cvs -d :pserver:<<your_java_net_id>>@cvs.dev.java.net:/cvs checkout phobos
cd phobos/phobos
ant dist

This results in a dist directory being created. This kind of "distribution" contains all the Phobos jar files, javascript framework sources and ancillary web content (e.g. the Dojo toolkit). It doesn't contain any application code though, nor is it immediately runnable. It can still be useful on its own right; for instance, you can use it to create the latest version of a jar, which you can then copy to your GlassFish installation, or to a shared directory of your servlet container.

If you checked out jMaki in a directory other than a sibling of the Phobos one, you should set the jmaki.dir property accordingly.

For developer convenience, we included a NetBeans 5.5 project file in the phobos/phobos/nbproject directory. It can be used to build and test Phobos from inside the IDE. It also supports running Phobos in standalone mode for debugging purposes.

Building Phobos as a web application

Follow the directions in the preceding paragraph, only with a different ant target:

ant dist-webapp
Ant will create a dist-webapp directory which contains a skeletal web application with all Phobos libraries and scripts. Just like a regular distribution, it doesn't contain any application code.

Building the NetBeans plugins

Some of the plugins are shared between jMaki and Phobos, so you need to build two separate suites:

ajax/ide-plugins/netbeans/AJAX-suite
phobos/ide-plugins/netbeans-plugins/phobos-suite

The easiest way to build them is to open them in NetBeans and build them there. Once the two suites are built and all the contained plugins are installed in the IDE, you'll get a complete development environment for Phobos applications.

Building a Phobos IDE distribution

When you are running NetBeans with the Phobos plugins, you can have them point to a different Phobos distribution by going to the Tools -> Options -> Miscellaneous -> Phobos options pane and changing the Phobos location. This is useful if you have made any changes to Phobos and now you want to test them out using the IDE.

There is a special ant target which builds a dist-ide directory suitable for use as Phobos location in the IDE:

ant dist-ide

Building the Phobos sample applications

The sample applications are under phobos/apps. Just cd to that directory and type:

ant

The resulting applications will be in the dist subdirectory. Each application is in three formats: .tgz, .zip and .war. The war format is suitable for deployment on any servlet container.

Running the unit tests

You can run the unit tests using the test ant target:

ant test

Running Findbugs on the Phobos codebase

If you have the excellent FindBugs tool installed on your machine, you can unleash it on the Phobos codebase by setting the findbugs.home property to your findbugs installation and typing

ant findbugs
The report, in HTML format, can be found under the build directory, with the name of findbugs.html.
 
 
Close
loading
Please Confirm
Close