I have a build.gradle setup with the following (I obviously excluded parts that don't matter for brevity):
android { defaultConfig { ndk { abiFilters 'armeabi', 'armeabi-v7a', 'x86' } } productFlavors { flavor1 { ... } flavor2 { ... } flavor3 { ... } flavor4 { ... } flavor5 { ... } } buildTypes { debug { externalNativeBuild { ndkBuild { cFlags '-DDEBUG' } } ... } release { externalNativeBuild { ndkBuild { cFlags '-DRELEASE' } } ... } } externalNativeBuild { ndkBuild { path 'jni/Android.mk' } }
it works, but it compiles its own code for each + buildType attribute. so not only debug and release, but also flavor1Debug, flavor2Release, etc., which takes forever
how can I say gradle only for externalNativeBuild for two types of build and use them for all flavors?
source share