File tree Expand file tree Collapse file tree 4 files changed +27
-14
lines changed Expand file tree Collapse file tree 4 files changed +27
-14
lines changed Original file line number Diff line number Diff line change
1
+ ## 6.0.1
2
+
3
+ - Don't require ` json_annotation ` in ` dependencies ` if it's just used in tests.
4
+
1
5
## 6.0.0
2
6
3
7
- Added support for ` JsonSerializable.constructor ` to allow specifying an
Original file line number Diff line number Diff line change @@ -52,13 +52,13 @@ class _UnifiedGenerator extends Generator {
52
52
53
53
@override
54
54
Future <String ?> generate (LibraryReader library, BuildStep buildStep) async {
55
- await pubspecHasRightVersion (buildStep);
56
-
57
55
final values = < String > {};
58
56
59
57
for (var generator in _generators) {
60
58
for (var annotatedElement
61
59
in library.annotatedWith (generator.typeChecker)) {
60
+ await pubspecHasRightVersion (buildStep);
61
+
62
62
final generatedValue = generator.generateForAnnotatedElement (
63
63
annotatedElement.element, annotatedElement.annotation, buildStep);
64
64
for (var value in _normalizeGeneratorOutput (generatedValue)) {
Original file line number Diff line number Diff line change 1
1
name : json_serializable
2
- version : 6.0.0
2
+ version : 6.0.1
3
3
description : >-
4
4
Automatically generate code for converting to and from JSON by annotating
5
5
Dart classes.
Original file line number Diff line number Diff line change @@ -132,6 +132,16 @@ Future<void> _structurePackage({
132
132
133
133
await d.file ('pubspec.yaml' , pubspec).create ();
134
134
135
+ /// A file in the lib directory without JsonSerializable should do nothing!
136
+ await d.dir (
137
+ 'lib' ,
138
+ [
139
+ d.file ('no_op.dart' , '''
140
+ class NoOp {}
141
+ ''' )
142
+ ],
143
+ ).create ();
144
+
135
145
await d.dir (
136
146
sourceDirectory,
137
147
[
@@ -155,18 +165,17 @@ class SomeClass{}
155
165
workingDirectory: d.sandbox,
156
166
);
157
167
158
- await proc.stdoutStream ().forEach (print);
168
+ final lines = StringBuffer ();
169
+ await for (var line in proc.stdoutStream ()) {
170
+ lines.writeln (line);
171
+ print (line);
172
+ }
159
173
160
- await expectLater (
161
- proc.stdout,
162
- emitsThrough (
163
- emitsInOrder ([
164
- '[SEVERE] json_serializable:json_serializable on $sourceDirectory /sample.dart:' ,
165
- '' ,
166
- message,
167
- ]),
168
- ),
169
- );
174
+ expect (lines.toString (), contains ('''
175
+ [SEVERE] json_serializable:json_serializable on $sourceDirectory /sample.dart:
176
+
177
+ $message
178
+ ''' ));
170
179
171
180
await proc.shouldExit (1 );
172
181
}
You can’t perform that action at this time.
0 commit comments