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

Relands https://github.com/flutter/flutter/pull/163890 and updates the
Ninja path used by the engine tool
This commit is contained in:
Jason Simmons 2025-02-27 00:13:58 +00:00 committed by GitHub
parent 0f3b092a10
commit 1d25f6953d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 15 additions and 5 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

View File

@ -583,8 +583,7 @@ final class BuildRunner extends Runner {
bool success = false;
try {
final String ninjaPath = p.join(
engineSrcDir.path,
'flutter',
engineSrcDir.parent.parent.path,
'third_party',
'ninja',
'ninja',

View File

@ -116,7 +116,8 @@ void main() {
// Check that the events for the Ninja command are correct.
expect(events[2] is RunnerStart, isTrue);
expect(events[2].name, equals('$buildName: ninja'));
expect(events[2].command[0], contains('ninja'));
final String rootPath = path.dirname(path.dirname(engine.srcDir.path));
expect(events[2].command[0], equals('$rootPath/third_party/ninja/ninja'));
final String configPath = '${engine.srcDir.path}/out/${targetBuild.ninja.config}';
expect(events[2].command.contains(configPath), isTrue);
for (final String target in targetBuild.ninja.targets) {

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