Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

Configuring a custom Android artifact name

Tymen Steur edited this page Mar 27, 2018 · 6 revisions

You can configure an Android project to use a different archive base name. Specifying a different archive base name will affect the resulting artifact filename. This is useful when you have specific requirements for the artifact filename e.g. include the version.

Note: Only the 'base' of the artifact filename can set. The Android variant will always be appended to the filename.

Support

The bintray-release plugin supports this behavior since version 0.8.1.

Example

You can configure a different archive base name by setting the archivesBaseName property in your build.gradle. In the following sample code the project's versionName is added to the default archivesBaseName.

android {
  ...

  defaultConfig {
    minSdkVersion 21
    targetSdkVersion 27
    versionCode 1
    versionName "1.0.0"
    archivesBaseName = "$archivesBaseName-$versionName"
  }
}

This will result in an artifact name of myapp-1.0.0-release.aar instead of the default myapp-release.aar.