Hi all,
I'm trying to build an app for both J2ME and J2SE. The presentation code will obviously be different, but I'm hoping to keep the logic common, as much as possible.
My plan is to use Ant or Antenna's preprocessor to select either the J2ME or J2SE Graphics object, with that class being the only intersection between my logic and display code. All I need is to swap a line or two of imports in a few files during my Ant/Antenna build task.
I'd like some advice on how to get this set up.
I've currently got two Eclipse projects, one J2ME and one J2SE. I have a couple ideas for how I could set up the preprocessor:
- Have the J2SE code be the default, and only preprocess the J2SE code to swap in the J2SE specific imports
- Use the Antenna preprocessor for both the J2ME and J2SE projects
- Use Ant text substitution to make the necessary source modifications
i) looks hard to get set up right
ii) feels a bit kludgy
iii) seems least bad, because I don't see myself ever needing to use much more than a few conditional imports.
Has anyone had experience with this sort of thing? Some advice would be much appreciated.