Skip source files attributed to 'dart:' libraries when writing a dep file.
Change-Id: I656edd730c1bb2433768646295cf3ab4325819c1 Reviewed-on: https://dart-review.googlesource.com/c/77985 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Siva Annamalai <asiva@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
45a5bc063a
commit
218d30e26a
@@ -636,12 +636,27 @@ String _escapePath(String path) {
|
||||
return path.replaceAll(r'\', r'\\').replaceAll(r' ', r'\ ');
|
||||
}
|
||||
|
||||
List<Uri> _getDependencies(Component component) {
|
||||
var deps = <Uri>[];
|
||||
for (Library lib in component.libraries) {
|
||||
if (lib.importUri.scheme == 'dart') {
|
||||
continue;
|
||||
}
|
||||
deps.add(lib.fileUri);
|
||||
for (LibraryPart part in lib.parts) {
|
||||
final Uri fileUri = lib.fileUri.resolve(part.partUri);
|
||||
deps.add(fileUri);
|
||||
}
|
||||
}
|
||||
return deps;
|
||||
}
|
||||
|
||||
// https://ninja-build.org/manual.html#_depfile
|
||||
_writeDepfile(Component component, String output, String depfile) async {
|
||||
final IOSink file = new File(depfile).openWrite();
|
||||
file.write(_escapePath(output));
|
||||
file.write(':');
|
||||
for (Uri dep in component.uriToSource.keys) {
|
||||
for (Uri dep in _getDependencies(component)) {
|
||||
if (dep == null) continue;
|
||||
file.write(' ');
|
||||
file.write(_escapePath(dep.toFilePath()));
|
||||
|
||||
Reference in New Issue
Block a user