An Ant-to-End Solution For Wireless Java

Version 1.2.1

(c) 2002-2010

Erik Wetterberg
Sourceforge project

News | Overview | Download | Setup | JAD | Build | Package | MakePRC | RAPC
Run | Preverify | Obfuscate | SmartLink | Preprocess | Deploy | Sign | History |


The WtkRapc task invokes the BlackBerry rapc compiler. It takes for input a list of .java files, or a JAR file, and generates a .cod file that can be loaded onto the BlackBerry handset.

This Ant task assumes the BlackBerry build tools are already installed and accessible.

Before using this task, you must define property bb.buildjars.home, which defines where to find the BlackBerry rapc compiler, for example:

    <property name="bb.buildjars.home" location="..."/>

To define the RAPC task, do as follows:

    <taskdef name="wtkrapc" classname="de.pleumann.antenna.WtkRapc" classpath="${buildjars.home}/antenna-bin-0.9.12a.jar"/>

The task provides the following parameters:

Parameter Type Required Purpose
jadfile file yes The name of the JAD file to use
source file yes List of .java files or the name of the JAR file containing the input java classes.
codename string yes The codename to for the generated .cod file.
import file yes List of import libraries, such as the BlackBerry Java APIs.
destdir file yes If specified, indicates the directory where to copy the JAD, ALX, and generated .cod file.
quiet boolean no If specified, indicates to use the -quiet argument indicating rapc to use the quiet console output mode.
midlet boolean no If specified, indicates to use the -midlet argument, indicating rapc to build a MIDlet and corresponding JAR.
library boolean no If specified, indicates to use the -library argument, indicating rapc to build a library.


<target name="rapc" description="RIM COD Compiler" depends="jar">
    <wtkrapc jadfile="${jadfile}" source="${jarfile}" codename="${codename}" import="${bb.api.jar}" destdir="output/tocod/"/ quiet="true" midlet="false">

It is good practice to build your MIDP application using Antenna's steps WtkBuild and so on, which produces a JAR file, and input this JAR file into the RAPC step. This approach allows you to separate the generation of standard MIDlet and BlackBerry packaging.

*Note that the BlackBerry tools, such as RAPC, are only available on Microsoft Windows platforms.