Skip to content

Commit a00e79f

Browse files
authored
Trying to support the latest version of pkg/build (#31)
1 parent 6ba5db2 commit a00e79f

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ environment:
77
sdk: '>=1.24.0 <2.0.0-dev.infinity'
88
dependencies:
99
analyzer: '>=0.29.10 <0.31.0'
10-
build: ^0.9.0
10+
build: '>=0.9.0 <0.11.0'
1111
cli_util: ^0.1.0
1212
path: ^1.3.2
1313
source_gen: ^0.7.0
1414
dev_dependencies:
15-
build_runner: ^0.3.2
15+
build_runner: ^0.4.0
1616
build_test: ^0.6.0
1717
collection: ^1.14.0
1818
test: ^0.12.3

tool/build.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
// for details. All rights reserved. Use of this source code is governed by a
44
// BSD-style license that can be found in the LICENSE file.
55

6+
import 'dart:io';
7+
68
import 'package:build_runner/build_runner.dart';
79

8-
import 'phases.dart';
10+
import 'build_actions.dart';
911

1012
main() async {
11-
await build(phases, deleteFilesByDefault: true);
13+
var result = await build(buildActions, deleteFilesByDefault: true);
14+
if (result.status == BuildStatus.failure) {
15+
exitCode = 1;
16+
}
1217
}

tool/phases.dart renamed to tool/build_actions.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import 'package:build_runner/build_runner.dart';
66
import 'package:json_serializable/generators.dart';
77
import 'package:source_gen/source_gen.dart';
88

9-
final PhaseGroup phases = new PhaseGroup.singleAction(
10-
new PartBuilder(const [
11-
const JsonSerializableGenerator(),
12-
const JsonLiteralGenerator()
13-
]),
14-
new InputSet('json_serializable',
15-
const ['example/*.dart', 'test/test_files/*.dart']));
9+
final List<BuildAction> buildActions = [
10+
new BuildAction(
11+
new PartBuilder(const [
12+
const JsonSerializableGenerator(),
13+
const JsonLiteralGenerator()
14+
]),
15+
'json_serializable',
16+
inputs: const ['example/*.dart', 'test/test_files/*.dart'])
17+
];

tool/watch.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import 'package:build_runner/build_runner.dart';
66

7-
import 'phases.dart';
7+
import 'build_actions.dart';
88

99
main() {
10-
watch(phases, deleteFilesByDefault: true);
10+
watch(buildActions, deleteFilesByDefault: true);
1111
}

0 commit comments

Comments
 (0)