'Dynamically exclude files from the APK
I would like to exclude a list of dynamically computed files from my APK. I can exclude a list of predefined files with:
android {
packagingOptions {
exclude 'file1.ext'
exclude 'file2.ext'
...
}
}
but the list of files to exclude is calculated by a custom task (which relies on the dependencies). I tried this but the new exclusion is ignored:
task excludeResources {
doLast {
project.android.packagingOptions.excludes += "file1.ext"
}
}
project.afterEvaluate {
preBuild.dependsOn excludeResources
}
Is there a way to dynamically add exclusions during tasks execution ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
