The script inside settings.gradle dynamically searches for all *.gradle files to determine the list of gradle projects/modules. This script needs to be optimized as the initial filter of excluded files/directories searches in certain directories like src, build and out, which is resulting in a costly search.

It may be as simple as adding '**/build', '**/src', '**/out' in the excludes filter but there may be other options to consider for this optimization.

This change is very sensitive so we need to ensure any changes made do not break the build. Some sort of test needs to be performed to compare the current build with the new build containing the changes.

NOTE: This change should also be back-ported to all applicable and supported branches.

Comment From: rwinch

The amount of time to find the build files is currently 35 ms which is rather negligible in the grand scheme of things. I think we should use a build scan to prioritize items that are taking more time.