Build Tools
AFC comes with an Ant build script in build.xml
. This document lists the tools required to run it.
Setup
Many open-source libraries in the Java world include in the download everything needed to build a product from its sources. With AFC, I have relaxed this a little. The source download does include all of the required run-time libraries, as well as all the libraries required to build the .jar files, with the exception of Ant itself.
It does not include all the libraries and tools to build an entire distribution. Those are described here, with instructions on how to get and configure them. Except for Ant and JUnit, all of the tools should be configured in build.properties
. Look in build.default.properties
to see what you can configure.
Prepackaged Download
The easiest setup is to simply download formulacompiler-x.y.z-tools.zip
, unpack it to a central folder, and then set tools.dir
to this folder in build.properties
. If you unpack it into AFC’s install folder as tools/
, then you don’t even have to create build.properties
.
The download contains Ant and, contained within it, JUnit 3.x. So running
tools/apache-ant-1.7.1/bin/ant
should properly build AFC.
Note
You still need to install the prerequisites for Rextile and Graphviz.
Manual Setup
Mandatory Tools
The following are the tools you need to set up in order to build a complete new distribution package for AFC. I strongly suggest you install them all if you consider contributing to AFC.
- Ant
- You do, of course, need. Since Ant is rather big and such a widespread tool, I have chosen to not include it with AFC’s source distribution. This is the only install you need to run
ant build
which builds the AFC jars. - JUnit
- is needed to run the tests with
ant test
. As per the instructions and, in particular, this discussion, I suggest that you copyjunit.jar
to thelib/
folder of your Ant installation. - Macker
- checks class and package dependencies. AFC uses it to enforce the most important dependency rules. Configure it in
build.properties
(see above). - CheckStyle
- checks source code conformance. AFC uses it to check for missing JavaDoc tags and header comments. Configure it in
build.properties
(see above). - Ruby
- runs configuration scripts.
- Rextile
- compiles documentation sources in Textile format to XHTML. AFC’s main documentation is written in Rextile’s format (this here, too). Please observe Rextile’s own installation instructions. Configure it in
build.properties
(see above). - JCite
- cites Java source code and Excel sheets into HTML documentation. AFC uses this extensively. Configure it in
build.properties
(see above). - GraphViz
- renders textual specifications of graphs to .png images. The
dot
command must be available on the system path.
Optional Tools
The following tools are not required to build a distribution, but they certainly help to maintain high quality.
- Cobertura
- is a code coverage analysis tool, which you can run with
ant cover
. Configure it inbuild.properties
(see above). - Emma
- is, too, a code coverage analysis tool. It runs much faster than Cobertura, but produces—in my view—slightly less visually pleasing output. Configure it in
build.properties
(see above).