forked from dart-lang/build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take a single Builder in BuilderTransformer (dart-lang#138)
Typical use case is to have a single Builder and this will make it easier to write helper code around using BuilderTransformers for codegen. - Take a single Builder in the constructor of BuilderTransformer - Remove looping around builders - Add MultiplexingBuilder to make it easier to compose builders for the few use cases that may need it - Update package version as a breaking change - Loosen version constraint from build_test since it is not impacted - Update tests to use the new interface and expect slightly different log messages
- Loading branch information
Showing
9 changed files
with
117 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.2.0+1 | ||
|
||
- Forwards compatible version bump in package:build | ||
|
||
## 0.2.0 | ||
|
||
- Upgrade build package to 0.4.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
name: build_test | ||
description: Utilities for writing unit tests of Builders. | ||
version: 0.2.0 | ||
version: 0.2.0+1 | ||
author: Dart Team <[email protected]> | ||
homepage: https://github.com/dart-lang/build | ||
|
||
dependencies: | ||
build: ^0.4.0 | ||
build: ">=0.4.0 <0.6.0" | ||
logging: ^0.11.2 | ||
test: ^0.12.0 | ||
watcher: ^0.9.7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) 2016, 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 'dart:async'; | ||
|
||
import '../asset/id.dart'; | ||
import 'build_step.dart'; | ||
import 'builder.dart'; | ||
|
||
/// A [Builder] that runs multiple delegate builders asynchronously. | ||
/// | ||
/// **Note**: All builders are ran without ordering guarantees. Thus, none of | ||
/// the builders can use the outputs of other builders in this group. All | ||
/// builders must also have distinct outputs. | ||
class MultiplexingBuilder implements Builder { | ||
final Iterable<Builder> _builders; | ||
|
||
MultiplexingBuilder(this._builders); | ||
|
||
@override | ||
Future build(BuildStep buildStep) => | ||
Future.wait(_builders.map((builder) => builder.build(buildStep))); | ||
|
||
/// Collects declared outputs from all of the builders. | ||
/// | ||
/// If multiple builders declare the same output it will appear in this List | ||
/// more than once. This should be considered an error. | ||
@override | ||
List<AssetId> declareOutputs(AssetId inputId) => | ||
_collectOutputs(inputId).toList(); | ||
|
||
Iterable<AssetId> _collectOutputs(AssetId id) sync* { | ||
for (var builder in _builders) { | ||
yield* builder.declareOutputs(id); | ||
} | ||
} | ||
|
||
@override | ||
String toString() => '$_builders'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: build | ||
version: 0.4.1+3 | ||
version: 0.5.0 | ||
description: A build system for Dart. | ||
author: Dart Team <[email protected]> | ||
homepage: https://github.com/dart-lang/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters