Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Testing and Deployment

Posts: 11
Registered: ‎09-09-2010
My Device: bold
My Carrier: developing third party app for Blackberry

problem in building the application using Ant

[ Edited ]

Actually i want to build my BB application using BB ant tool. it is working fine but there is one issue

like the resources i include(eg images) are added directly , means it is not creating the directory structure as is defined in the application.

When i build the same application using JDE it is creating the directory structure as is defined in the application.

I tested it by extracting the Jar file that is created after compiling the application.

When build using JDE the res folder is created and within that folder other folders are created ant the images are present in those folders.


But when i build it using BB ant, no folder is created, images are directly added to the main folder, but for src it is creating the directory structure.


the script i am using is




<?xml version="1.0" encoding="UTF-8"?>

<project name="DexKnows" default="simulate" basedir=".">

<taskdef resource="bb-ant-defs.xml" classpath="lib/bb-ant-tools.jar" />

<property name="jdehome" value="D:\Program Files\Research In Motion\BlackBerry JDE 4.6.1" />

<property name="simulator" value="${jdehome}\simulator" />

<property name="bin" value="${jdehome}\bin" />
<property name="jdk" location="C:\Program Files\Java\jdk1.6.0_14"/>

<target name="debug" depends="deploy" description="Builds, Deploys Project and Launches Remote Debug Server">
<exec executable="cmd.exe" dir="${bin}" spawn="true">
<arg value="jdwp.bat" />

<target name="simulate" depends="crearezip" description="Builds, Deploys Project and Launches Simulator">
<exec executable="cmd.exe" dir="${simulator}" spawn="true">

<arg value="8900.bat" />

<target name="deploy" depends="buildRIM" description="Builds and Deploys Project">
<copy todir="${simulator}" overwrite="true">
<fileset dir="output">
<include name="*.cod" />
<include name="*.csl" />
<include name="*.cso" />

<target name="buildRIM" depends="buildLib" description="Builds Project">
<rapc jdehome="${jdehome}" jdkhome="${jdk}" output="DexKnows" quiet="false" defines="PREPROCESSOR;ANALYTICS_ENABLED" destdir="output" verbose="true" import="lib/FlurryAgent.jar">
<jdp type="cldc" title="DexKnows" vendor="mportal" version="Version=0.9" description="DexKnows"
<fileset dir=".">

<include name="src/**/*.java"/>
<include name="**/*.rrc" />
<include name="**/*.rrh" />
<include name="res/**/*.*"/>

<target name="buildLib" description="Builds Project">
<rapc jdehome="${jdehome}" jdkhome="${jdk}" output="FlurryAgent" quiet="false" destdir="output">

<jdp type="library" title="title" vendor="vendor" version="1.0" description="description" arguments="" systemmodule="false" runonstartup="false" startuptier="7"
<fileset dir=".">
<include name="lib/FlurryAgent.jar"/>

<target name="sign" depends="buildRIM">
<sigtool jdehome="${jdehome}" codfile="D:\DexKnows\DexKnows_7Sep\DexKnows.cod" />

<target name="crearezip" depends="deploy">
<jadtool input="output/DexKnows.jad" destdir="output/ota">
<fileset dir="output" includes="*.cod" />
<override key="Dex" value="dex1" />





Posts: 12
Registered: ‎10-29-2010
My Device: Not Specified

Re: problem in building the application using Ant

Hi........im facing the same problem and hence not able to run my application......can you please share the solution......it'll be really helpful......thanks in advance

New Contributor
Posts: 7
Registered: ‎04-29-2010
My Device: 8300
My Carrier: Telinor

Re: problem in building the application using Ant

<path id="src.files">
<fileset dir="src" includes="**/*" />
<fileset dir="res" includes="**/*" />



<target name="build" depends="">
<mkdir dir="${dest.dir}" />
jdkhome="C:/Program Files/Java/jdk1.6.0_29"
<src refid="src.files" />



You can try it like this.. its not complete rapc command but just a hint how can you include source as well as resources.

If dont work let me know...