Add a buildtools directory and move third_party/ninja to the project root in order to match the expectations of depot_tools (#163890)

The depot_tools Ninja wrapper looks for Ninja at specific paths within
the tree. The use of "name": "." in the engine's .gclient file is not
expected by the depot_tools logic for locating the engine's source
directory.

This PR creates an alternative layout that is supported by depot_tools.
If the project root directory contains a "buildtools" subdirectory, then
depot_tools will look for Ninja at "third_party/ninja" within the root.

Fixes https://github.com/flutter/flutter/issues/163487
This commit is contained in:
Jason Simmons 2025-02-26 15:11:31 +00:00 committed by GitHub
parent 80233283c3
commit 3d018b5924
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 12 additions and 2 deletions

2
DEPS
View File

@ -637,7 +637,7 @@ deps = {
],
'dep_type': 'cipd',
},
'engine/src/flutter/third_party/ninja': {
'third_party/ninja': {
'packages': [
{
'package': 'infra/3pp/tools/ninja/${{platform}}',

1
buildtools/README.md Normal file
View File

@ -0,0 +1 @@
This directory is a placeholder intended to make Flutter's source tree match the expectations of [depot_tools](https://www.chromium.org/developers/how-tos/depottools/), which is used to build the Flutter engine.

View File

@ -1632,6 +1632,7 @@ Future<void> verifyRepositoryLinks(String workingDirectory) async {
'glfw/glfw',
'GoogleCloudPlatform/artifact-registry-maven-tools',
'material-components/material-components-android', // TODO(guidezpl): remove when https://github.com/material-components/material-components-android/issues/4144 is closed
'ninja-build/ninja',
'torvalds/linux',
'tpn/winsdk-10',
};

View File

@ -2295,7 +2295,6 @@
../../../flutter/third_party/libwebp/swig
../../../flutter/third_party/libwebp/tests
../../../flutter/third_party/libwebp/webp_js
../../../flutter/third_party/ninja
../../../flutter/third_party/ocmock
../../../flutter/third_party/perfetto/.clang-format
../../../flutter/third_party/perfetto/.clang-tidy

9
third_party/.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Ignore everything by default, as these come from gclient/DEPS.
# We'll explicitly include the folders we want to track.
/*
# Include the .gitignore file itself.
!.gitignore
# Allow custom README.flutter files in each folder.
**/README.flutter