Monday, 19 August 2019

Application Variant do Last for App Bundle

I have entered below code in my Gradle.

///start
    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            println("Roop: mappingFile:  ${output.outputFile}")
        }
            variant.assemble.doLast {
//            doLast {
                File dir = new File("${project.projectDir}/out1")
                dir.mkdirs()
                println("Roop: copy")
                variant.outputs.each { output ->
                    File file = output.outputFile
                    println("Roop: file:" + file)
                }
            }
    }

Now when i perform Build Apk from android studio, Variant.assemble.doLast gets executed after apk is created. But the same doLast is not called if i perform Build Bundle.

Any info why doLast does not get called for BuildBundle ?



from Application Variant do Last for App Bundle

No comments:

Post a Comment