title: How to change path for release APK artifact?
body: <p>How can I configure a Gradle Android project so that a release APK built by the IDE is saved to a path of my choosing (eg the project root) rather than buried deep in the build folder?</p>
  
  <p>I've added this to the defaultConfig section of the app build file to sensibly name the APK and it works well, but how can I specify where it goes, or move it post build completion?</p>
  
  <pre><code>archivesBaseName = "AppName-v$versionName"  // AppName-v1.2.3-release.apk
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I created a task in the app-level Gradle build file that successfully copies the release APK, if I run the Gradle task manually:</p>
  
  <pre><code>task copyReleaseApk(type: Copy) {
      from 'build/outputs/apk'
      into '..' // project root, one-level above "app"
      include '**/*release.apk'
  }
  </code></pre>
  
  <p>But I have not yet found a way to make the task run automatically after the last build task. I tried this:</p>
  
  <pre><code>assembleRelease.finalizedBy(copySupportFiles)
  </code></pre>
  
  <p>But that results in "Could not get unknown property 'assembleRelease' for object of type com.android.build.gradle.AppExtension."</p>
  
  <p>I also tried this:</p>
  
  <pre><code>assembleRelease.finalizedBy(copySupportFiles)
  </code></pre>
  
  <p>It appears not to do anything.</p>