Developer's corner
This section is intented for people interested in extending/maintaing Cobertura for J2ME.
It provides basic information on how to build and deploy as well as a rough description of the design.
Were can I find the source code?
The source code is available on SVN (https://svn.sourceforge.net/svnroot/cobertura4j2me).
back to top
How do I setup my build environement?
An ant script is provided to perform the different build steps
- The first thing to do is to either unzip the source archive in the location of you choice (e.g. C:\WORK\cobertura-j2me\) or check out the trunk directory from the SVN repository.
You should see a directory structure as follows:
+- doc/
+- lib/
+- res/
+- src/
- build.xml
- build.properties
where 'src/' contains the source code.
|
- Make sure ant is installed on your system. Check out http://ant.apache.org for more information.
- You also need Sun's Wireless Toolkit (version 2.2 onwards). Visit http://java.sun.com/javame.
-
Then you need to modify build.properties:
# the build version
cobertura4j2me-version=1.1.0
### MODIFY HERE ###
# MUST BE CLDC1.1
jar.cldc=C:/APPS/WTK22/lib/cldcapi11.jar
jar.midp=C:/APPS/WTK22/lib/midpapi20.jar
jar.jsr75-file=C:/APPS/WTK22/lib/jsr75.jar
preverifier.exe=C:/APPS/WTK22/bin/preverify.exe
back to top
How do I build?
Simply type the following command:
ant build
This script will generate the output in a folder called release.
This directory should contain 2 zip files:
- cobertura4j2me-x_y_z-bin.zip
- cobertura4j2me-x_y_z-src.zip |
Where x_y_z is the version specified in the properties file
back to top
What do I need to know before modifying the code?
The following section describes how the source code is organized and how the coverage
data is collected and persisted.
First of all, the code is organized as follows:
- org.cobertura4j2me.ant
- org.cobertura4j2me.merge
- org.cobertura4j2me.reporting
- org.cobertura4j2me.reporting.html
- org.cobertura4j2me.reporting.html.files
- org.cobertura4j2me.reporting.xml
- org.cobertura4j2me.runtime
- org.cobertura4j2me.runtime.j2se
- org.cobertura4j2me.runtime.midp
- org.cobertura4j2me.util
|
I will concentrate on the runtime packages and the coverage data handling. Below are listed the key points
of the design:
back to top
|