title: Android - How do I dynamically set the package name at build time for an Open-source project?
body: <p>I'm working on an Open-source project. As it is intended that anyone can download the source and build it themselves, I do not want to hard-code the package name <em>anywhere</em> - including the directory structure.</p>
  
  <p>I use <code>ant</code> for building. Apparently I can modify <code>build.xml</code>, but I believe this is overwritten by <code>android update</code>. Whatever is used will be committed to the Git repo, and it should not be too complicated.</p>
  
  <p>Currently the process to build the code straight from the Git repo is fairly simple. Here's an excerpt from the <code>README</code> file:</p>
  
  <pre><code>$ cd ~/src/isokeys/IsoKeys
  $ android list targets # I build against API level 10.
  $ android update project --name IsoKeys --target 1 --path ./ # Only needed first time.
  $ ant debug &amp;&amp; adb -d install -r bin/IsoKeys-debug.apk
  </code></pre>
  
  <p>To me, it makes sense to put the package name in <code>local.properties</code>, because this is <code>.gitignore</code>'d. As the package name won't be anywhere else, the build will fail without doing this. So there needs to be at least 1 extra step in the <code>README</code>, but I want to keep it to a minimum.</p>
  
  <p>Edit: Of course, another requirement is that diffs make sense - which they don't if you manually rename the package name.</p>