Skip to content

Commit acac841

Browse files
committed
Cleanup.
1 parent d53fa7f commit acac841

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

build_runner_core/lib/src/asset_graph/graph.dart

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ class AssetGraph implements GeneratedAssetHider {
382382
});
383383

384384
_addSources(newIds);
385+
385386
var newAndModifiedNodes = [
386387
for (var id in modifyIds.followedBy(newIds)) get(id)!,
387388
];
@@ -398,9 +399,8 @@ class AssetGraph implements GeneratedAssetHider {
398399
digestReader,
399400
);
400401

401-
// Collects the set of all transitive ids to be removed from the graph,
402-
// based on the removed `SourceAssetNode`s by following the
403-
// `primaryOutputs`.
402+
// Compute generated nodes that will no longer be output because their
403+
// primary input was deleted. Delete them.
404404
var transitiveRemovedIds = <AssetId>{};
405405
void addTransitivePrimaryOutputs(AssetId id) {
406406
if (transitiveRemovedIds.add(id)) {
@@ -414,26 +414,8 @@ class AssetGraph implements GeneratedAssetHider {
414414
addTransitivePrimaryOutputs(id);
415415
}
416416
}
417-
418-
// The generated nodes to actually delete from the file system.
419417
var idsToDelete = Set<AssetId>.from(transitiveRemovedIds)
420418
..removeAll(removeIds);
421-
422-
// TODO(davidmorgan): ensure deleted outputs are updated.
423-
// We definitely need to update manually deleted outputs.
424-
/*for (var deletedOutput in removeIds
425-
.map(get)
426-
.nonNulls
427-
.where((n) => n.type == NodeType.generated)) {
428-
updateNode(deletedOutput.id, (nodeBuilder) {
429-
nodeBuilder.generatedNodeState.pendingBuildAction =
430-
PendingBuildAction.build;
431-
});
432-
}*/
433-
434-
_addOutputsForSources(buildPhases, newIds, rootPackage);
435-
436-
// Delete all the invalidated assets.
437419
await Future.wait(idsToDelete.map(delete));
438420

439421
// Change deleted source assets and their transitive primary outputs to
@@ -446,6 +428,8 @@ class AssetGraph implements GeneratedAssetHider {
446428
}
447429
}
448430

431+
_addOutputsForSources(buildPhases, newIds, rootPackage);
432+
449433
_outputs = null;
450434
return idsToDelete;
451435
}

0 commit comments

Comments
 (0)