android {
defaultConfig {
applicationId = "com.company.android"
versionName = "1.2.3.4"
versionCode = System.getenv("BUILD_NUMBER") as Integer ?: 4711
archivesBaseName = applicationId + "-" + versionName + ".${versionCode}"
...
buildTypes {
debug {
applicationIdSuffix = ".debug"
example output: com.company.android-1.2.3.4.3799-debug.apk or
com.company.android-1.2.3.4.666-release.aab
i got deprecation warning because archivesBaseName is moved to base plugin.
i tried to use base plugin, but there i have no access to variables from defaultConfig (and i do not want to duplicate them).
I need alltogether (the suffix for variants, the versionName, versionCode (read from jenkins variable) and the extension (apk or aab) (handled automatically when using baseName, but breaking when filename is set manually.
documentation also says that base plugin is only for compatiblity.
please tell/add to documentation the correct way to to this, i think this use case is quite common and we use it in all of our projects.