I don't think variant.processManifest.doLast is not being called (at all). 
It IS being called, just after every clean build (or if you build a new 
flavour). The solution to this is quite simple. Just assign 
variant.processResources.manifestFile outside of the 
variant.processManifest.doLast{} block and check if "filtered_manifests" 
exists, as in:

        def filteredManifest = 
"${buildDir}/filtered_manifests/${variant.dirName}/AndroidManifest.xml"
        variant.processManifest.doLast {
            // this gets called only on every clean build (or new/switched? 
flavour build)
            addScreenSupportToManifest(variant, screenSizeXml); // local 
method
        }
        // if the filtered manifest exists replace the original manifest 
with this one (only valid on every non-clean/non-built build)
        if (new File(filteredManifest).exists()) {
            variant.processResources.manifestFile = file(filteredManifest)
        }

(I can give you the whole code if anyone needs it)

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to