forked from dart-lang/build
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_status.dart
76 lines (61 loc) · 2.51 KB
/
build_status.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:built_collection/built_collection.dart';
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
import 'build_target.dart';
part 'build_status.g.dart';
class BuildStatus extends EnumClass {
static const BuildStatus started = _$started;
static const BuildStatus succeeded = _$succeeded;
static const BuildStatus failed = _$failed;
static Serializer<BuildStatus> get serializer => _$buildStatusSerializer;
const BuildStatus._(String name) : super(name);
static BuildStatus valueOf(String name) => _$valueOf(name);
static BuiltSet<BuildStatus> get values => _$values;
}
/// The build result for a single target.
abstract class BuildResult {
BuildStatus get status;
String get target;
String? get buildId;
String? get error;
bool? get isCached;
}
abstract class DefaultBuildResult
implements
BuildResult,
Built<DefaultBuildResult, DefaultBuildResultBuilder> {
static Serializer<DefaultBuildResult> get serializer =>
_$defaultBuildResultSerializer;
factory DefaultBuildResult([void Function(DefaultBuildResultBuilder) b]) =
_$DefaultBuildResult;
DefaultBuildResult._();
}
/// The group of [BuildResult]s for a single build done by the daemon.
///
/// Since the daemon can build multiple targets in parallel, the results are
/// grouped together.
///
/// Build results will only be provided if the client has registered a target
/// that was built.
abstract class BuildResults
implements Built<BuildResults, BuildResultsBuilder> {
static Serializer<BuildResults> get serializer => _$buildResultsSerializer;
factory BuildResults([Function(BuildResultsBuilder b) updates]) =
_$BuildResults;
BuildResults._();
BuiltList<BuildResult> get results;
/// A list of asset URIs that were modified since the last build.
///
/// This includes both sources that were updated and affected generated assets
/// that were rebuilt.
///
/// To avoid communication overhead for clients not interested in this field,
/// it is not set by default. To enable it, register at least one target with
/// [DefaultBuildTarget.reportChangedAssets].
/// However, build implementations can unconditionally set this field as it
/// is stripped out in the daemon server implementation.
BuiltList<Uri>? get changedAssets;
}