Skip to main content

Ability to use the pre-processor to make out MIDP Apps?

3 replies [Last post]
68060
Offline
Joined: 2011-08-29
Points: 0

Hi, I added configurations to my MIDP project and they worked just fine, but then I came to needing pre-processor stuff (im building out 5 variations of something and want it to be autoated so I dont have to manually edit 1 variable) - this didnt seem to work because when I had :

//#ifdef ONE
public static final int MODE=MODE_AGENT_APP;
//#endif
//#ifdef TWO
public static final int MODE=MODE_GIC_AGENTS;
//#endif

even selecting the profile that has the "ability" ONE wouldnt comment out the code in TWO for me - so I tested with the "non midp" version of the project and they seemed to work. So I went ahead and removed them from MIDP project and put them in the ordinary one which seemed to work, the values with no abilities commented out just fine when I swapped between configs.. Problem is now its not building the MIDP ones (I had to set the normal app as my "main project" rather than my midp one) only the "ordinary" ones which dont run on a phone - so the question is - how do I define configs that can have different abilities and have them work, yet also build out the MIDP versions of my app??

I hope this is clear, and someone can answer fast! :-))

Gaz.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
68060
Offline
Joined: 2011-08-29
Points: 0

No responses no solutions? this is a HUGE problem for the way I automate my builds using ant, now its gonna take like 10 mins of manually labour to export my builds :-/ not fun at all!!

Just in case I explained it badly, chedck this video which demonstrates what im saying:

http://www.youtube.com/watch?v=xKnZWO0yrvk

vprise
Offline
Joined: 2003-11-07
Points: 0

Netbeans has a builtin preprocessor and we automate our release builds completely, see the build.xml for the UI project in SVN where we pick configurations for every target.

We only use preprocessor for targeting RIM devices since the RIM API is so broken in many different ways. We generally try to avoid preprocessor for anything other than debug logging which should be wrapped using the #debug preprocessor to improve performance of a release version.

Eugen.Martynov
Offline
Joined: 2011-09-16
Points: 0

We use Antenna preprocessor that has task for the ant. But to run app on sim or the device you have to first trigger build with ant. There is preprocessor section in Eclipse mobile project. but I don't use Eclipse too much.

Thanks,

Eugen