flutter build appbundle Modify input path and name (修改flutter 打Bundle 包的名称和路径)

在gradle中修改

 tasks.whenTaskAdded { task ->
    if (task.name.startsWith("bundle")) {
        def renameTaskName = "update${task.name.capitalize()}Aab"
        def flavor = task.name.substring("bundle".length()).uncapitalize()
        tasks.create(renameTaskName, Copy) {
            def path = "${buildDir}/outputs/bundle/${flavor}/"
            from(path)
            include "app-release.aab"
            destinationDir file("${buildDir}/outputs/updateBundle/")
            rename "app-release.aab", "xxxx-${defaultConfig.versionName}(${defaultConfig.versionCode})-${releaseTime()}.aab"
        }
        task.finalizedBy(renameTaskName)
    }