Android defaultConfig archivesBaseName deprecated

android {
    defaultConfig {
        applicationId = ""
        versionName = ""
        versionCode = System.getenv("BUILD_NUMBER") as Integer ?: 4711

        archivesBaseName = applicationId + "-" + versionName + ".${versionCode}"
       buildTypes {
	        debug {
				applicationIdSuffix = ".debug"

example output: or

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.

You can sure set base.archivesBaseName at the same place you set archivesBaseName in your example.
But also there it is deprecated.
But you can there also use the replacement base.archivesName.