EMMA
 
  Font size:      
 

Building EMMA

Getting EMMA sources

There are several ways of getting EMMA sources, depending on whether you want to deal with CVS or not (and how).

Committers
If you are a member of EMMA project with CVS commit privileges the instructions below do not apply to you: instead, you should create and work out of a developer sandbox.

Downloading buildable sources without using CVS

This is available for point release builds only (so you won't be able to get EMMA trunk or branch tips this way). For each major.minor.build release build there is an emma-major.minor.build-src.zip distribution that contains full sources for EMMA core and ANT tasks, with build instructions. You can get these from EMMA's SourceForge download page.

Obtaining buildable source via anonymous CVS

Anonymous (read-only) access to all EMMA sources is provided by SourceForge automatically. You don't need to be a member of EMMA project to get EMMA sources this way.

Getting the trunk tip

The password for SourceForge's "anonymous" CVS account is empty (hit enter if you get prompted). This will download EMMA's main module to the current directory:

>cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/emma co emma

Getting the tip for a given release branch

Use a BRANCH_major_minor branch tag, for example:

>cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/emma co -r BRANCH_2_0 emma

Getting a given point release

Use a STABLE_major_minor_build or RELEASE_major_minor_build point release tag, for example:

>cvs -d:pserver:anonymous@cvs.sf.net:/cvsroot/emma co -r RELEASE_2_0_4208 emma

Which of these methods you use depends on your goals. If your objective is to build your own version of EMMA derived from a point release or research a possible bug in a given point release, you should probably get sources for that release. If your objective is to add a new feature, you should probably go for the trunk or a branch tip. Either way, when contributing a patch or modified sources you should specify the baseline against which you have made your modifications. If you aren't sure what you should do, do your work against EMMA's CVS trunk.

Eclipse as a CVS client

Built-in CVS support in Eclipse eliminates the need for setting up a separate command line client. The above instructions for using anonymous access to SourceForge's CVS translate directly to Eclipse:

  1. Open "CVS Repositories" view.
  2. Configure a new repository location:
    • Host: cvs.sf.net
    • Repository path: /cvsroot/emma
    • User: anonymous
    • Password: <leave empty>
    • Connection type: pserver
  3. After Eclipse connects to SourceForge's CVS, you can expand various nodes under the repository location object and do "Check Out As...". Depending on which node you choose to check out as a Java project, you will create different CVS project sandboxes (conceptually, these three choices correspond precisely to the three anonymous CVS examples described above):
    • Using a module under "HEAD" will check out the trunk tip.
    • Using a module under "Branches" will check out the tip for a given branch. To make Eclipse aware of the existing EMMA branch tags you need to choose "Refresh Branches..." and select emma module in the following dialog.
    • Using a module under any of the subnodes of "Versions" will create a sandbox "frozen" at a given stable or release CVS tag. (Eclipse calls CVS tags "versions": do not confuse those with normal EMMA offering versions.)

Both versions 2.1 and 3.0 of Eclipse work with SourceForge's CVS. Furthermore, the extssh connection type fully supports non-anonymous (developer) CVS work without requiring an external SSH client.

Making a private EMMA build

To build a private version of EMMA is very straighforward. All you need is a supported JDK install and a supported ANT version. (Even if you use Eclipse as an IDE, you have to use ANT to build EMMA.)

Build requirements
EMMA sources should build in ANT 1.5-1.6 and JDK 1.4. No other configuration is supported officially (although it may work for you).

After you've obtained EMMA sources as described above, cd into the directory containing build.xml and create a file build.properties that tells the build where your JDK and ANT are located:

  • build.target.j2se.14.home: (optionally) set this property to the jre subdirectory of your JDK 1.4 install. This property defaults to ${java.home} in ANT and will be automatically set correctly if Java 1.4 is your currently installed Java version.

  • build.target.ant.15.home: (optionally) set this property to the directory containing your ANT 1.5 or ANT 1.6 install. This property defaults to whatever your shell variable ANT_HOME is set to and will be automatically set correctly if ANT_HOME points to ANT 1.5+.

Now, execute the default build target (build):

>ant

Assuming this is successful, EMMA jars will be copied to ${basedir}/${dist.dir} directory, which defaults to ./dist.

To remove all generated build artifacts and reset the build to a clean state, execute:

>ant clean

More build properties

You can further customize build properties related to where build artifacts go:

  • out.dir: this is where all intermediate build output (auto-generated and compiled classes, etc) goes. This defaults to ${basedir}/out. This directory is deleted by ant clean.

  • dist.dir: this directory collects all final distribution output (jars, etc). This defaults to ${basedir}/dist. This directory is deleted by ant clean.

Here is an example of a customized build.properties file:

out.dir                   = /TEMP/emmaout
dist.dir                  = /TEMP/emmadist

build.target.j2se.14.home = /Java/JDK1.4.2/jre
build.target.ant.15.home  = /Apache/apache-ant-1.5.4

Private build stamping

Private EMMA builds are functionally equivalent to the official SourceForge releases and are assigned similar build numbers, except the version stamp will also say "(unsupported private build)" as a reminder that this version was not produced via the officially-managed EMMA release process.