BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 11-16-2007, 02:00 AM   #1 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question conditional compilation

Please Login to Remove!

In the NetBeans IDE, each configuration also sets a "preprocessor" #define such that you can conditionally compile code. Any way to do this in the BB JDE? If not exactly the same way, then at least to the same effect. It looks like the only use of configurations in the BB JDE is to specify which projects get built. I can't really factor the conditional code into different projects without creating what are mostly duplicates.
Offline  
Old 11-16-2007, 05:10 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

people tend to use netbeans or eclipse because they are (way) more powerful compared to the RIM JDE.
Invest some work into the ant-tasks and be rewarded with a lot more time saved.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 11-16-2007, 12:25 PM   #3 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

As simon.hain said, both Netbeans and Eclipse are way better than the JDE in terms of general usability. There are some things that need to be done manually outside of JDE, but the overall cost savings is worth it, to me at least.

For Eclipse, there are a couple ways to handle pre-processing: Antenna and EclipseME. Below are links to their respective pages on it.

Antenna: Antenna
EclipseME: EclipseME - Preprocessing

I don't personally use pre-processing so I can't really speak to how well either of those are suited to your needs, but you might want to check them out (or just go back to Netbeans).
Offline  
Old 11-16-2007, 02:02 PM   #4 (permalink)
New Member
 
Join Date: Nov 2007
Model: 1xp
PIN: N/A
Carrier: upyours cellular
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well when I started this what I tried to do is take the .jar output(s) from NetBeans and use rapc to compile into a .cod. I eventually got to the point where rapc would complain "Error!907: unable to verify security something or other". I guess I'll look into going from NetBeans directly to .cod.
Offline  
Old 11-16-2007, 02:31 PM   #5 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you use ant already you might want to check out the etaras tasks.

eTaras.com RAPC ant task

Here's an example of how to use it. Neither the jdw nor jdp files need to exist, so don't worry about that.

<property name="bb.home" value="C:\Program Files\Research In Motion\BlackBerry JDE 4.2.1"/>

<taskdef name="rim" classname="com.etaras.anttask.rapc.RAPC" classpath="lib/anttask-rapc-1.8.jar" />

<target name="build" description="RIM COD Compiler">
<rim jdehome="${bb.home}">
<workspace src="com_foo_app.jdw" update="false">
<cldc src="com_foo_app.jdp"
title="My App"
vendor="Richard Puckett II"
version="1.0.0"
description="My Awesome Application"
systemmodule="false"
runonstartup="false"
startuptier="7"
ribbonposition="0"
output="com_foo_app"
options="-quiet"
update="false"
build="true"
alx="false">

<files dir=".">
<include name="src/**/*.java" />
<include name="res/**/*.*" />
</files>

</cldc>
</workspace>
</rim>
</target>

In addition to "cldc" there are also "midlet" and "library" tasks.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.