title: Inserting build target using build.xml only?
body: <p>I have a build.xml which is capable of compiling and optimizing if I run the build targets individually - "ant compile" followed by "and optimize". </p>
  
  <p>The problem is, that I want to run "ant release" which would normally do Everything necessary to produce the release binary, but I need to insert a build target to the chain - the target is called "optimize" and it runs a proguard optimize/shrinker against the class files just before the "dex" stage builds the byte code. </p>
  
  <p>The template file /opt/android-sdk-linux_x86/platforms/android-8/templates/android_rules.xml contains the following rule, which I could modify to say "depends="compile,optimize" " But I don't want to have to re-modify the file for every different SDK that comes out (with a new android_rules.xml file each time). </p>
  
  <pre><code>&lt;!-- Converts this project's .class files into .dex files --&gt;
  &lt;target name="-dex" depends="compile"&gt;
      &lt;dex-helper /&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>Is there an alternative to modifying the template xml and instead putting all compile rules into the build.xml? </p>