I have an application for Android which comes in two forms: a trial version and a paid "pro" version. The two versions coexists in Android Market and have different package names (let's call them com.app.trial and com.app.pro). They share the same codebase. When I have to switch between trial and pro builds in Eclispe, I have to spend no less than 20 minutes each time editing the code to make it build the correct version. My procedure looks like this:
Rename package name in AndroidManifest.xml (also rename app versionName, and versionCode).
Click on main package name "com.app.pro" (if pro was the lastest build and now I want to make a trial build) and select Refactor->Rename (check 'Update references' and 'Rename subpackages') and let Eclipse do the renaming.
After this comes the hard part: in my code many files still import the "old" package name, "com.app.pro" instead of being automatically changed to "com.app.trial". In some cases Eclipse adds those references during the renaming, for no apparent reasons (there are no references to this specific package from within a given Java file). I have to manually edit all the instances.
My question is:
How do I make this procedure less time consuming? I also have been using NetBeans where there's a handy support for #ifdefs (aka Abilities) which really makes switching between builds a breeze. Eclipse unfortunately has no support (at least no buil-in support) for #ifdefs.
Any suggestions would be greatly appreciated.
P.S. For the reference I am using Eclipse Ganymede version 3.4.2 but also tried a newer version, it does the same.