title: How to set name of AAR output from Gradle
body: <p>I have a project with several modules in it one of which is a Android Library named (poorly) as <code>sdk</code>. When I build the project it outputs an AAR named <code>sdk.aar</code>.</p>
  
  <p>I haven't been able to find anything in the Android or Gradle documentation that allows me to change the name of the AAR output. I would like it to have a basename + version number like the Jar tasks do, but I can't work out how to do the same for the AAR because all the config for it seems to be hidden in the android.library plugin.</p>
  
  <p>Renaming the module isn't an option at this stage and that still wouldn't add the version number to the final AAR.</p>
  
  <p>How can I change the name of the AAR generated by <code>com.android.library</code> in Gradle?</p>
  
  <p><strong>Gradle solution</strong></p>
  
  <pre><code>defaultConfig {
      minSdkVersion 9
      targetSdkVersion 19
      versionCode 4
      versionName '1.3'
      testFunctionalTest true
      project.archivesBaseName = "Project name"
      project.version = android.defaultConfig.versionName
  }
  </code></pre>