@@ -10,7 +10,7 @@ import 'package:built_value/built_value.dart';
10
10
import 'package:built_value/serializer.dart' ;
11
11
import 'package:crypto/crypto.dart' ;
12
12
13
- import '../generate/phase .dart' ;
13
+ import 'post_process_build_step_id .dart' ;
14
14
15
15
part 'node.g.dart' ;
16
16
@@ -23,7 +23,6 @@ class NodeType extends EnumClass {
23
23
static const NodeType glob = _$glob;
24
24
static const NodeType internal = _$internal;
25
25
static const NodeType placeholder = _$placeholder;
26
- static const NodeType postProcessAnchor = _$postProcessAnchor;
27
26
static const NodeType source = _$source;
28
27
static const NodeType missingSource = _$missingSource;
29
28
@@ -54,10 +53,6 @@ abstract class AssetNode implements Built<AssetNode, AssetNodeBuilder> {
54
53
/// [AssetNode.glob] .
55
54
GlobNodeState ? get globNodeState;
56
55
57
- /// Additional node configuration for an
58
- /// [AssetNode.postProcessAnchorNodeConfiguration] .
59
- PostProcessAnchorNodeConfiguration ? get postProcessAnchorNodeConfiguration;
60
-
61
56
/// The assets that any [Builder] in the build graph declares it may output
62
57
/// when run on this asset.
63
58
BuiltSet <AssetId > get primaryOutputs;
@@ -66,19 +61,14 @@ abstract class AssetNode implements Built<AssetNode, AssetNodeBuilder> {
66
61
/// which reads this asset.
67
62
BuiltSet <AssetId > get outputs;
68
63
69
- /// The [AssetId] s of all [AssetNode.postProcessAnchor] assets for which this
70
- /// node is the primary input.
71
- BuiltSet <AssetId > get anchorOutputs;
72
-
73
64
/// The [Digest] for this node in its last known state.
74
65
///
75
66
/// May be `null` if this asset has no outputs, or if it doesn't actually
76
67
/// exist.
77
68
Digest ? get lastKnownDigest;
78
69
79
- /// The IDs of the [AssetNode.postProcessAnchor] for post process builder
80
- /// which requested to delete this asset.
81
- BuiltSet <AssetId > get deletedBy;
70
+ /// The `PostProcessBuildStep` s which requested to delete this asset.
71
+ BuiltSet <PostProcessBuildStepId > get deletedBy;
82
72
83
73
/// Whether this asset is a normal, readable file.
84
74
///
@@ -223,35 +213,6 @@ abstract class AssetNode implements Built<AssetNode, AssetNodeBuilder> {
223
213
static AssetId createGlobNodeId (String package, String glob, int phaseNum) =>
224
214
AssetId (package, 'glob.$phaseNum .${base64 .encode (utf8 .encode (glob ))}' );
225
215
226
- /// A [primaryInput] to a [PostBuildAction] .
227
- ///
228
- /// The [outputs] of this node are the individual outputs created for the
229
- /// [primaryInput] during the [PostBuildAction] at index [actionNumber] .
230
- factory AssetNode .postProcessAnchor (
231
- AssetId id, {
232
- required AssetId primaryInput,
233
- required int actionNumber,
234
- required AssetId builderOptionsId,
235
- Digest ? previousInputsDigest,
236
- }) => AssetNode ((b) {
237
- b.id = id;
238
- b.type = NodeType .postProcessAnchor;
239
- b.postProcessAnchorNodeConfiguration.actionNumber = actionNumber;
240
- b.postProcessAnchorNodeConfiguration.builderOptionsId = builderOptionsId;
241
- b.postProcessAnchorNodeConfiguration.primaryInput = primaryInput;
242
- });
243
-
244
- factory AssetNode .postProcessAnchorForInputAndAction (
245
- AssetId primaryInput,
246
- int actionNumber,
247
- AssetId builderOptionsId,
248
- ) => AssetNode .postProcessAnchor (
249
- primaryInput.addExtension ('.post_anchor.$actionNumber ' ),
250
- primaryInput: primaryInput,
251
- actionNumber: actionNumber,
252
- builderOptionsId: builderOptionsId,
253
- );
254
-
255
216
AssetNode ._() {
256
217
// Check that configuration and state fields are non-null exactly when the
257
218
// node is of the corresponding type.
@@ -277,10 +238,6 @@ abstract class AssetNode implements Built<AssetNode, AssetNodeBuilder> {
277
238
globNodeConfiguration != null ,
278
239
globNodeState != null ,
279
240
);
280
- check (
281
- type == NodeType .postProcessAnchor,
282
- postProcessAnchorNodeConfiguration != null ,
283
- );
284
241
}
285
242
}
286
243
@@ -387,27 +344,6 @@ abstract class GlobNodeState
387
344
GlobNodeState ._();
388
345
}
389
346
390
- // Additional configuration for an [AssetNode.postProcessAnchor].
391
- abstract class PostProcessAnchorNodeConfiguration
392
- implements
393
- Built <
394
- PostProcessAnchorNodeConfiguration ,
395
- PostProcessAnchorNodeConfigurationBuilder
396
- > {
397
- static Serializer <PostProcessAnchorNodeConfiguration > get serializer =>
398
- _$postProcessAnchorNodeConfigurationSerializer;
399
-
400
- int get actionNumber;
401
- AssetId get builderOptionsId;
402
- AssetId get primaryInput;
403
-
404
- PostProcessAnchorNodeConfiguration ._();
405
-
406
- factory PostProcessAnchorNodeConfiguration (
407
- void Function (PostProcessAnchorNodeConfigurationBuilder ) updates,
408
- ) = _$PostProcessAnchorNodeConfiguration ;
409
- }
410
-
411
347
/// Work that needs doing for a node that tracks its inputs.
412
348
class PendingBuildAction extends EnumClass {
413
349
static Serializer <PendingBuildAction > get serializer =>
@@ -427,8 +363,8 @@ class PendingBuildAction extends EnumClass {
427
363
@SerializersFor ([AssetNode ])
428
364
final Serializers serializers =
429
365
(_$serializers.toBuilder ()
430
- ..add (AssetIdSerializer ())
431
- ..add (DigestSerializer ()))
366
+ ..add (const AssetIdSerializer ())
367
+ ..add (const DigestSerializer ()))
432
368
.build ();
433
369
434
370
/// Serializer for [AssetId] .
@@ -455,6 +391,8 @@ class AssetIdSerializer implements PrimitiveSerializer<AssetId> {
455
391
AssetId object, {
456
392
FullType specifiedType = FullType .unspecified,
457
393
}) => object.toString ();
394
+
395
+ const AssetIdSerializer ();
458
396
}
459
397
460
398
/// Serializer for [Digest] .
@@ -478,4 +416,6 @@ class DigestSerializer implements PrimitiveSerializer<Digest> {
478
416
Digest object, {
479
417
FullType specifiedType = FullType .unspecified,
480
418
}) => base64.encode (object.bytes);
419
+
420
+ const DigestSerializer ();
481
421
}
0 commit comments