I’m using the Maven Android Plugin to build my application.
Actually, I’m building 3 “branded” versions of the same app (the app icon, colors, etc… change, but not the features). I’m aware that I need to use a different package name for each application, for them to be considered as different.
So far I have managed to have “dynamic” values, using Maven filters in strings.xml :
<string name="app_name">${app_name}</string>
<string name="widget_name">${widget_name}</string>
<string name="app_icon">${app_icon}</string>
The problem is that this does not work for the package name ! If I do :
<manifest package="${foo.bar}">
ADT (well, the XML validator actually) complains saying attribute package has invalid character ‘$’
I can’t find any workaround for this… Is there a way to tell ADT to launch the Maven resources filtering or something like that ?
After further research, it appears to be fairly easy !
You just need to add
<renameManifestPackage>in the configuration of the Maven Android Plugin. Seems to work starting at version > 2.9.0 :