0

I need to know how to use an an Ant tool for preprocessing in Blackberry. I have a project which needs to be used in 4.6 and 5.0 versions of Blackberry, since JDE4.6 doesn't support preprocessor. I need to know how we can use Ant tool in Eclipse?

Any sites or example will do.

I referred this site.

Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
Yatin
  • 2,969
  • 9
  • 34
  • 68
  • since JDE 4.6 doesn't support preprocessor, all preprocessor directives are simply ignored, you could try to take adantage of that. – G B May 04 '12 at 06:38
  • about Ant ?? But how can i make its use ... I have never used ant ... Please guide me – Yatin May 04 '12 at 06:50
  • 1
    You don't need Ant, you can use preprocessor directives in your code, if the JDE doesn't support them, they are ignored. – G B May 04 '12 at 06:59
  • I have used preprocessor directives for So can you tell me which .cod file should i use .. the one i get it from 4.5 or the one which i get it from 5.0 eclipse Because , i need to load only one build for both the devices of 4.5 and 5.0 – Yatin May 04 '12 at 07:47
  • Because ... when i upload a .cod file from 5.0 in 4.5 simulator it gives an error that the project-1.cod file not found ... And when i upload a .cod file from 4.5 into 5.0 simulator i do not get the desired result that is the code part which should be executed in 5.0 for project which i written in preprocessor is still considered as comment . – Yatin May 04 '12 at 07:58
  • I can't understand your problem. You have 2 different builds (that's what preprocessor directives are for), and 2 different simulators. You need 2 different run configuration to test them. – G B May 07 '12 at 07:05
  • You can't use a 5.x .cod file on a 4.x device/simulator. You have to use the 4.x .cod file insted. The whole point of using the preprocessor is to allow a single codebase to produce different outputs for different devices. You create a preprocessor define that enables 5.x features in your code, then set a 5.x JRE in the project, and compile into a 5.x .cod file. Then disable the define, set a 4.x JRE in the project, and recompile into a 4.x .cod file. Then deploy the two .cod files to different devices/simulators as needed. – Remy Lebeau May 08 '12 at 21:05
  • To use the same .cod file in both 4.x and 5.x means you can only use 4.x features in your code and a 4.x JRE in the project. To have a single .cod file that dynamically uses newer JRE features when available on newer devices is much more complicated to setup. Using separate .cod files for different JRE versions, sometimes even device-specific .cod files, is the better approach. – Remy Lebeau May 08 '12 at 21:08

2 Answers2

1

http://www.blackberryforums.com/developer-forum/138210-setup-up-eclipse-blackberry-development.html

and

http://bb-ant-tools.sourceforge.net/docs

This both links will be very helpful to you as a use Ant tool in blackberry eclipse.

Rajkiran
  • 259
  • 4
  • 13
0

Eclipse has a versioning preprocessor plugin. It's like a preprocessor who's only commands are #define and #ifdef

However I wanted something more myself. I don't know how to use Ant, but I did just manage to get the C preprocessor working in Eclipse on windows for java, using the non-Ant Builders and some glue in Ruby. I wanted it for an android project, maybe for similar reasons to why you would want it for Blackberry.

Since I was looking for an answer on Stackoverflow before I rolled my own and didn't find one, I'm copying my post into a few questions like this one:

https://stackoverflow.com/a/10497206/1137626

Community
  • 1
  • 1
Josh S
  • 147
  • 1
  • 7