Skip to content Skip to sidebar Skip to footer

Android Build Configurations For Multiple Customers

I have Android application that needs to be delivered to multiple customers. For every customer I have different graphics and configuration XML files which specify features and URL

Solution 1:

I ended up using maven profiles and 'renameManifestPackage' and 'resourceOverlayDirectory' properties of the android maven plugin.

The default res/ dir is overriden by 'resourceOverlayDirectory' specific for every customer.

It worked out great.

<!-- profile for zurich --><profile><id>zurich</id><properties><customer>zurich</customer><customerPackage>zurich.com</customerPackage><customerResources>customers/${customer}/res</customerResources><customerApkName>${customer}-${project.artifactId}</customerApkName></properties></profile>

and in the build I have:

<build><sourceDirectory>src</sourceDirectory><!-- the name of the generated apk and jar --><finalName>${customerApkName}-${project.version}</finalName><pluginManagement><plugins><!-- customer specific manifest and package --><plugin><groupId>com.jayway.maven.plugins.android.generation2</groupId><artifactId>maven-android-plugin</artifactId><configuration><renameManifestPackage>${customerPackage}</renameManifestPackage><resourceOverlayDirectory>${customerResources}</resourceOverlayDirectory></configuration></plugin></plugins></pluginManagement>

Solution 2:

Don't know how well this is supported for Android projects, but the usual way is to define a profile for each customer. In each profile you should override the relevant resource directories with the ones for the specified customer.

Post a Comment for "Android Build Configurations For Multiple Customers"