I am trying to create an application for J2ME and J2SE. The presentation code will obviously be different, but I hope to keep as much logic as possible.
My plan is to use an Ant or Antenna preprocessor to select a J2ME or J2SE Graphics object, this class being the only intersection between my logic and the displayed code. All I need to do is swap two or two import lines in multiple files during my Ant / Antenna build task.
I would like some advice on tuning.
I currently have two Eclipse projects, one J2ME and one J2SE. I have a couple of ideas on how I can configure the preprocessor:
- Use the default J2SE code and only pre-process the J2SE code for exchange in special import versions of J2SE.
- Use the Antenna preprocessor for J2ME and J2SE projects.
Use Ant text replacement to make necessary changes to the original state
I. It looks hard to configure correctly
II. feels a bit kludgy
III. seems the least bad because I don’t see that I ever needed to use much more than a few conditional imports.
Does anyone have experience with this kind of thing? Some tips would be greatly appreciated.
source
share