Skip to content

WIP: Trying to support the latest version of pkg/build #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ environment:
sdk: '>=1.24.0 <2.0.0-dev.infinity'
dependencies:
analyzer: '>=0.29.10 <0.31.0'
build: ^0.9.0
build: '>=0.9.0 <0.11.0'
cli_util: ^0.1.0
path: ^1.3.2
source_gen: ^0.7.0
dev_dependencies:
build_runner: ^0.3.2
build_runner: ^0.4.0
build_test: ^0.6.0
collection: ^1.14.0
test: ^0.12.3
9 changes: 7 additions & 2 deletions tool/build.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
// 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 'dart:io';

import 'package:build_runner/build_runner.dart';

import 'phases.dart';
import 'build_actions.dart';

main() async {
await build(phases, deleteFilesByDefault: true);
var result = await build(buildActions, deleteFilesByDefault: true);
if (result.status == BuildStatus.failure) {
exitCode = 1;
}
}
16 changes: 9 additions & 7 deletions tool/phases.dart → tool/build_actions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import 'package:build_runner/build_runner.dart';
import 'package:json_serializable/generators.dart';
import 'package:source_gen/source_gen.dart';

final PhaseGroup phases = new PhaseGroup.singleAction(
new PartBuilder(const [
const JsonSerializableGenerator(),
const JsonLiteralGenerator()
]),
new InputSet('json_serializable',
const ['example/*.dart', 'test/test_files/*.dart']));
final List<BuildAction> buildActions = [
new BuildAction(
new PartBuilder(const [
const JsonSerializableGenerator(),
const JsonLiteralGenerator()
]),
'json_serializable',
inputs: const ['example/*.dart', 'test/test_files/*.dart'])
];
4 changes: 2 additions & 2 deletions tool/watch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import 'package:build_runner/build_runner.dart';

import 'phases.dart';
import 'build_actions.dart';

main() {
watch(phases, deleteFilesByDefault: true);
watch(buildActions, deleteFilesByDefault: true);
}