At the moment ModuleCheck always depends on BuildConfig task. Before it runs, it would first force all modules to generate BuildConfig. While running on my project, I realized that this took long. That was not expected since we have BuildConfig disabled via the following property
android.defaults.buildfeatures.buildconfig = false
Even if it is disabled, ModuleCheck would force them to be generated. This is not needed