define LOCAL_SRC_FILES in ndk{} DSL
With experimental plugin 0.4.0, it is possible to exclude files from NDK build by pattern, e.g. android.sources { main { jni.source { srcDirs = [“~/srcs/jni”] exclude “**/win.cpp” } } } Thanks to Paul Spark! P.S. (thanks to rajveer): don’t miss Build/Clean after you change exclude! Old answer Unfortunately this is not supported by current gradle … Read more