Skip to content
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

Update to source_gen 0.9.0 #464

Merged
merged 3 commits into from
Jul 27, 2018
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

# 6.0.0

- Update to the latest `source_gen`. This generator can now be used with other
generators that want to write to `.g.dart` files without a manual build
script.
- Breaking change: The "header" configuration on this builder is now ignored.

# 5.5.5

- Allow SDK 2.0.0.
Expand Down
6 changes: 6 additions & 0 deletions benchmark/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ dev_dependencies:
built_value_generator: ^5.5.5
quiver: '>=0.21.0 <3.0.0'
test: ^1.0.0

dependency_overrides:
built_value:
path: ../built_value
built_value_generator:
path: ../built_value_generator
4 changes: 4 additions & 0 deletions built_value/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ dependencies:

dev_dependencies:
test: ^1.0.0

dependency_overrides:
built_value_generator:
path: ../built_value_generator
5 changes: 3 additions & 2 deletions built_value_generator/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ builders:
target: ":built_value_generator"
import: "package:built_value_generator/builder.dart"
builder_factories: ["builtValue"]
build_extensions: {".dart": [".g.dart"]}
build_extensions: {".dart": [".built_value.g.part"]}
auto_apply: dependents
build_to: source
build_to: cache
applies_builders: ["source_gen|combining_builder"]
5 changes: 2 additions & 3 deletions built_value_generator/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ import 'package:build/build.dart';
import 'package:built_value_generator/built_value_generator.dart';
import 'package:source_gen/source_gen.dart';

Builder builtValue(BuilderOptions options) => new PartBuilder([
new BuiltValueGenerator(),
], header: options.config['header'] as String);
Builder builtValue(BuilderOptions _) =>
new SharedPartBuilder([new BuiltValueGenerator()], 'built_value');
8 changes: 6 additions & 2 deletions built_value_generator/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: built_value_generator
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run tool/use_local_deps and update the PR; it will update all the yaml files to use the unreleased version, so the presubmit results are meaningful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran the tool and regenerated the example files.

version: 5.5.5
version: 6.0.0-dev
description: >
Value types with builders, Dart classes as enums, and serialization.
This library is the dev dependency.
Expand All @@ -17,10 +17,14 @@ dependencies:
build_config: ^0.3.1
built_collection: '>=2.0.0 <4.0.0'
built_value: ^5.5.5
source_gen: '>=0.7.4 <0.9.0'
source_gen: ^0.9.0
quiver: '>=0.21.0 <3.0.0'

dev_dependencies:
build_test: ^0.10.0
build_runner: ^0.9.0
test: ^1.0.0

dependency_overrides:
built_value:
path: ../built_value
2 changes: 1 addition & 1 deletion built_value_generator/test/built_value_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ abstract class Value implements Built<Value, ValueBuilder> {

final String pkgName = 'pkg';

final Builder builder = new PartBuilder([new BuiltValueGenerator()]);
final Builder builder = new PartBuilder([new BuiltValueGenerator()], '.g.dart');

Future<String> generate(String source) async {
final srcs = <String, String>{
Expand Down
2 changes: 1 addition & 1 deletion built_value_generator/test/enum_class_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ final String pkgName = 'pkg';

// Recreate BuiltValueGenerator for each test because we repeatedly create
// enums with the same name in the same library, which will clash.
Builder get builder => new PartBuilder([new BuiltValueGenerator()]);
Builder get builder => new PartBuilder([new BuiltValueGenerator()], '.g.dart');

Future<String> generate(String source) async {
final srcs = <String, String>{
Expand Down
2 changes: 1 addition & 1 deletion built_value_generator/test/serializer_generator_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ abstract class Value implements Built<Value, ValueBuilder> {

final String pkgName = 'pkg';

final Builder builder = new PartBuilder([new BuiltValueGenerator()]);
final Builder builder = new PartBuilder([new BuiltValueGenerator()], '.g.dart');

Future<String> generate(String source) async {
final srcs = <String, String>{
Expand Down
6 changes: 6 additions & 0 deletions built_value_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dependencies:
dev_dependencies:
built_value_generator: ^5.5.5
build_runner: ^0.9.0

dependency_overrides:
built_value:
path: ../built_value
built_value_generator:
path: ../built_value_generator
6 changes: 6 additions & 0 deletions chat_example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ dev_dependencies:
build_runner: ^0.9.0
built_value_generator: ^5.5.5
test: ^1.0.0

dependency_overrides:
built_value:
path: ../built_value
built_value_generator:
path: ../built_value_generator
6 changes: 6 additions & 0 deletions end_to_end_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ dev_dependencies:
fixnum: ^0.10.0
quiver: '>=0.21.0 <3.0.0'
test: ^1.0.0

dependency_overrides:
built_value:
path: ../built_value
built_value_generator:
path: ../built_value_generator
11 changes: 0 additions & 11 deletions example/build.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion example/lib/collections.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/enums.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/generics.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/interfaces.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/polymorphism.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/serializers.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/lib/values.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ dev_dependencies:
built_value_generator: ^5.5.5
quiver: '>=0.21.0 <3.0.0'
test: ^1.0.0

dependency_overrides:
built_value:
path: ../built_value
built_value_generator:
path: ../built_value_generator