@@ -153,6 +153,7 @@ class Build {
153
153
buildPhases,
154
154
);
155
155
if (result.status == BuildStatus .success) {
156
+ // ignore_for_file: lines_longer_than_80_chars
156
157
if (logFine) {
157
158
_logger.fine ('Failed? $builtAssets ' );
158
159
_logger.fine (
@@ -793,27 +794,33 @@ class Build {
793
794
);
794
795
assert (outputs.isNotEmpty, 'Can\' t run a build with no outputs' );
795
796
797
+ var inputNode = assetGraph.get (forInput)! ;
796
798
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) {
798
818
_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.' ,
800
820
);
801
821
}
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 ;
814
822
}
815
823
816
- var inputNode = assetGraph.get (forInput)! ;
817
824
if (inputNode.type == NodeType .generated) {
818
825
if (generatedNodeHasWorkToDo (forInput)) {
819
826
await _buildAsset (forInput);
@@ -1035,7 +1042,13 @@ class Build {
1035
1042
'Do not build ${renderer .build (forInput , outputs )} because '
1036
1043
'there is no reason to build it.' ,
1037
1044
);
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
+ }
1039
1052
1040
1053
return false ;
1041
1054
}
0 commit comments