Skip to content

Commit 73ea16a

Browse files
committed
Passing.
1 parent d22b580 commit 73ea16a

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

build_runner_core/lib/src/generate/build.dart

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class Build {
153153
buildPhases,
154154
);
155155
if (result.status == BuildStatus.success) {
156+
// ignore_for_file: lines_longer_than_80_chars
156157
if (logFine) {
157158
_logger.fine('Failed? $builtAssets');
158159
_logger.fine(
@@ -793,27 +794,33 @@ class Build {
793794
);
794795
assert(outputs.isNotEmpty, 'Can\'t run a build with no outputs');
795796

797+
var inputNode = assetGraph.get(forInput)!;
796798
if (deletedAssets.contains(forInput)) {
797-
if (logFine) {
799+
if (inputNode.type == NodeType.missingSource) {
800+
if (logFine) {
801+
_logger.fine(
802+
'Skip ${renderer.build(forInput, outputs)} because input was deleted.',
803+
);
804+
}
805+
for (final output in outputs) {
806+
assetGraph.updateNode(output, (nodeBuilder) {
807+
// TODO(davidmorgan): deleting the file here may be the fix for
808+
// https://github.com/dart-lang/build/issues/3875.
809+
nodeBuilder.digest = null;
810+
nodeBuilder.generatedNodeState.result = null;
811+
});
812+
}
813+
await failureReporter.markSkipped(
814+
outputs.map((id) => assetGraph.get(id)!),
815+
);
816+
return false;
817+
} else if (inputNode.type == NodeType.generated) {
798818
_logger.fine(
799-
'Skip ${renderer.build(forInput, outputs)} because input was deleted.',
819+
'Build ${renderer.build(forInput, outputs)} because it is a generated file that was deleted.',
800820
);
801821
}
802-
for (final output in outputs) {
803-
assetGraph.updateNode(output, (nodeBuilder) {
804-
// TODO(davidmorgan): deleting the file here may be the fix for
805-
// https://github.com/dart-lang/build/issues/3875.
806-
nodeBuilder.digest = null;
807-
nodeBuilder.generatedNodeState.result = null;
808-
});
809-
}
810-
await failureReporter.markSkipped(
811-
outputs.map((id) => assetGraph.get(id)!),
812-
);
813-
return false;
814822
}
815823

816-
var inputNode = assetGraph.get(forInput)!;
817824
if (inputNode.type == NodeType.generated) {
818825
if (generatedNodeHasWorkToDo(forInput)) {
819826
await _buildAsset(forInput);
@@ -1035,7 +1042,13 @@ class Build {
10351042
'Do not build ${renderer.build(forInput, outputs)} because '
10361043
'there is no reason to build it.',
10371044
);
1038-
builtAssets.addAll(outputs);
1045+
// builtAssets.addAll(outputs);
1046+
1047+
for (final output in outputs) {
1048+
if (!generatedNodeIsForcedBuild(output)) {
1049+
builtAssets.add(output);
1050+
}
1051+
}
10391052

10401053
return false;
10411054
}

0 commit comments

Comments
 (0)