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:
- use Ant (bb-ant-tools) to build my library into a JAR file
- include that JAR file in a project
- 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
- I can build the library project into a JAR using Ant.
- 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.
- 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.
Workaround
My current workaround is to include my SDK / library project as source code (as per esaj's answer below), rather than as a JAR file. This has some disadvantages over the JAR approach, but I have a build that runs on the device successfully.
(I hope its OK to cross-reference this question with the following long list of links?)
StackOverflow links:
- Continuous Integration server for blackberry development? (and certificate signing) (I haven't had time to go through this one, but I think it looks promising)
- Blackberry: Verificattion error when using Library project as External Jar
- https://stackoverflow.com/questions/6134940/how-to-use-external-library-jar-file-in-blackberry
- Blackberry 5.0 - Add reference to a Java Library Project
- How to add external jar or zip file in the Blackberry project
- Blackberry Apps - Importing a code-signed jar into an application project
- How to add library project with the current development project in blackberry
This one gives other links - quite useful:
These not so useful:
- In Blackberry, can we create common library that can be used by different applications?
- BlackBerry Facebook SDK jar file
- Adding and Testing Compatibility of External Jar to Blackberry Project
- How to attach Jar in Blackberry
- BlackBerry RIMAPPSA2 signing key required -- why?
- Is there a list of classes, methods and API which will trigger RIMAPPSA2 permission when signing Blackberry application?
RIM: