Skip to content

Building From Source

dwdyer edited this page Sep 13, 2010 · 6 revisions

This page describes how to build the Watchmaker Framework from source. You will need the following tools:

Getting the Source

First you need to get the source code. You can either checkout the latest version from Git, or you can download a snapshot from GitHub (either the latest code or a tagged release). If you want to make changes you should checkout the source using Git.

Using Git

Clone the Git repository using the following command:

git clone git://github.com/dwdyer/watchmaker

Forking on GitHub

If you intend to make your changes publicly available and/or submit them to be incorporated into the master repository, you should first fork the project on GitHub. You then clone your fork (using its private URL – the one with the ‘@’), rather than the main Watchmaker repository, to get your local working copy. Commit locally, push your changes to the forked repository and then send a pull request to have your changes reviewed for merging with the master repository. The process is described in this GitHub guide.

Building with Apache Ant

Watchmaker is built using Apache Ant. The build file uses the reusable macros from the Uncommons Antlib project. This is why the build requires Ant 1.7.1 or later (1.7.0 will not work).

You can list the available Ant targets in the usual way:

ant -p

To build everything that you need to run the examples, use the dist target:

ant dist

This builds all modules and puts everything that you need into the dist directory.

To build a full unit-tested release with API documentation use the release target:

ant release

This creates .zip and .tgz bundles in the release directory.

Unit Tests

The project uses TestNG for unit tests. If you know JUnit4 it should already be familiar, it’s where they got their ideas. Test reports are generated in docs/test-results/html by ReportNG and coverage reports are generated in docs/coverage/html, courtesy of Cobertura.

Editing Code

Since we’re using Ant, you can use any editor/IDE that you choose. You will find project files for IntelliJ IDEA 8.x in etc/intellij. There is also a NetBeans project file in etc/nbproject though this might be out-of-date as almost all development is done with IDEA. If you’re using Eclipse you’ll have to configure it yourself.