1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-05 17:30:16 +00:00
dart-sdk/build/dart
Zach Anderson 03101837d9 [gn] Deprecate copy_trees()
Part of https://github.com/flutter/flutter/issues/144430

This is a reland of https://dart-review.googlesource.com/c/sdk/+/356481 with the addition of dependencies to prevent races on directory creation.

Previously, this code did backflips to accomplish two goals
1. Collect the paths of all files that would be copied from one place to another after applying regex filters so that they could be listed as the "inputs" to a GN action.
2. Arrange so that the python script doing the above would only be invoked once during GN to reduce the cost of calling out to python.

However, this is exactly the use-case for the "depfile" parameter to a GN action. Instead of running the script during GN to populate the "inputs" list, when we run the copy_tree.py script, we can instead ask it to generate a depfile to collect all the input files that were actually copied after applying the regex filter. Using that, we don't have to run the python script at all during GN.

TEST=it builds

Change-Id: I593e2500544a9fff5dd9852d0d3370f97aafc464
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356620
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2024-03-09 04:14:39 +00:00
..
copy_tree.gni [gn] Deprecate copy_trees() 2024-03-09 04:14:39 +00:00
dart_action.gni [gn] Clean up some vestiges of building in the Fuchsia tree 2024-03-05 15:02:49 +00:00