Exclude the top-level engine directory from generate_gradle_lockfiles. (#161635)

For local development workflows, this would find directories we don't
want included in the script.

Added a simple test.
This commit is contained in:
Matan Lurey
2025-01-14 19:00:59 -08:00
committed by GitHub
parent 97acba4df8
commit fd1c02d301
2 changed files with 68 additions and 1 deletions

View File

@@ -304,7 +304,13 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
Iterable<Directory> discoverAndroidDirectories(Directory repoRoot) {
return repoRoot
.listSync(recursive: true)
.listSync()
.whereType<Directory>()
// Exclude the top-level "engine/" directory, which is not covered by the the tool.
.where((Directory directory) => directory.basename != 'engine')
// ... and then recurse into every directory (other than the excluded directory).
.expand((Directory d) => d.listSync(recursive: true))
.whereType<Directory>()
// ... where the directory ultimately is named "android".
.where((FileSystemEntity entity) => entity.basename == 'android');
}