Note that there are some explanatory texts on larger screens.

plurals
  1. POBuilding Android project to different packages
    text
    copied!<p>I'm trying to find the best way to build/package an Android app for 6+ different customers. I could use different branches in SVN for all of the customers, but the only difference between the apps are some values in the resource folder (drawables, strings, etc).</p> <p>I wrote an ant script that imports the standard Android <strong>build.xml</strong>. This script does the following:</p> <ol> <li>Reads the customer names from a properties file.</li> <li>For each customer the following is done: <ol> <li>The package name in <strong>AndroidManifest.xml</strong> is changed (by hooking into the <strong>-pre-build</strong> target).</li> <li>The custom resources are copied into the <strong>res</strong> directory in the build (by hooking into the <strong>-pre-compile</strong> target).</li> <li>The package name is changed back to the default value (by hooking into the <strong>-post-compile</strong> target).</li> <li>The APK is copied to a specific location an named something like <strong>customer-versionno.apk</strong>.</li> </ol></li> </ol> <p>This seemed to work well until I just now wrote the part that changes the package name. Because of the package name change the location of the <strong>R</strong> class is also changed, meaning that the build fails as the Java classes import the <strong>R</strong> class from the standard package.</p> <p>I don't want to have a build script that changes code. I want to be able to do this with minimum changes to any files.</p> <p>Soo..the questions are really:</p> <ol> <li>Are there any good/simple solutions for my problem?</li> <li>Am I approaching this problem in the wrong way? Are there better ways to easily package the same app to 6+ different customers?</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload