Alex Rivera | Logout

BlackBerry - Ant script to include JAR in project without external dependancies

Asked 2012-05-14T11:30:22.163
9

This is a follow-up to: BlackBerry - use own JAR file in own project & BlackBerry - Ant build script for more complex apps. This problem has now been solved below.

Aim

I want to:

  1. use Ant (bb-ant-tools) to build my library into a JAR file
  2. include that JAR file in a project
  3. use Ant to build that project into a COD that will run on the device (without external COD files).

The important part is to use Ant to do the final stage of the build.

All posts I have found for this problem use Eclipse for that final build stage (details at BlackBerry - use own JAR file in own project).


Progress

  1. I can build the library project into a JAR using Ant.
  2. In Eclipse, I can add that JAR file to a project, and build it as desired (single COD, no external dependencies). It will run on the device.
  3. In Ant, I can also make a build that relies on an extra COD library to contain the runtime code - this is close to what I need.

Problem

I can build the final project with Ant. But the resulting COD file does not include any runtime code from my library.

Many posts I have read show how this can be done using extra COD files for the library. I would like to avoid this.

How can I include a JAR into my project without external dependencies, using Ant? I believe this is possible because I can do it using Eclipse.


<
Edit
Report

1 Answer

4

Have you tried pointing to the library in the src section under rapc?

E.g.:

<rapc ...>
  <src>
    <fileset dir="${buildDirectory}">
      <include name="src/**/*.rrh" />
      <include name="src/**/*.rrc" />
      <include name="src/**/*.java" />
      <include name="res/**/*.*" />
      <!-- Libraries -->
      <include name="lib/**/*.*" />
    </fileset>
  </src>
</rapc>
answered 2012-05-17T10:36:38.733

Your Answer