title: How to set versionName in APK filename using gradle?
body: <p>I'm trying to set a specific version number in the gradle auto-generated APK filename. </p>
  
  <p>Now gradle generates <code>myapp-release.apk</code> but I want it to look something like <code>myapp-release-1.0.apk</code>.</p>
  
  <p>I have tried renaming options that seems messy. Is there a simple way to do this?</p>
  
  <pre><code>buildTypes {
      release {
         signingConfig signingConfigs.release
         applicationVariants.each { variant -&gt;
         def file = variant.outputFile
         variant.outputFile = new File(file.parent, file.name.replace(".apk", "-" +    defaultConfig.versionName + ".apk"))
      }
  }
  </code></pre>
  
  <p>I have tried the code above with no luck. Any suggestions?
  (using gradle 1.6)</p>