I have a flavor dimensions in module build.gradle file, and gradle build process runs through all build variants whatever actual build variant is. Here is module build.gradle:
flavorDimensions 'type', 'jnitype'
productFlavors {
demo {
dimension 'type'
versionNameSuffix '.demo'
}
production {
dimension 'type'
versionNameSuffix '.production'
}
usejni {
dimension 'jnitype'
versionNameSuffix '.usejni'
copy {
from('../jnilib/data') {
include 'sdk_data.gpu'
....
}
into 'src/main/assets/data'
}
}
nojni {
dimension 'jnitype'
versionNameSuffix '.nojni'
delete('src/main/assets/data/*.*')
packagingOptions {
exclude 'lib/arm64-v8a/sdk.so'
...
}
}
}
So no matter what build variant selected, demoUsejni or demoNojni, gradle runs through 'usejni' and then 'nojni' variants - it copies files and libraries, and then deletes them. I used gradle debug to confirm this.
How can I tell gradle to use just a selected build flavor?
AS 3.5.2, gradle plugin 5.4.1, android build tools 3.5.2.