Skip to content

Commit 28ff49b

Browse files
authored
Merge pull request #83 from davidmarne/update_analyzer_dev
Update analyzer dev
2 parents 89132dc + 3d0a417 commit 28ff49b

16 files changed

+81
-61
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.dart_tool/
12
.pub
23
packages
34
.packages

.travis.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ before_install:
1010

1111
script:
1212
- pub run build_runner build --delete-conflicting-outputs
13-
- pub run dart_dev format --check
14-
- pub run dart_dev analyze
15-
- pub run dart_dev test -p vm
16-
- pub run dart_dev coverage --no-html
17-
- bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov
13+
- dartfmt -n --set-exit-if-changed lib/
14+
- dartanalyzer --fatal-warnings --fatal-infos lib/
15+
- pub run build_runner test --delete-conflicting-outputs
1816
- pub run build_runner test --delete-conflicting-outputs -- -p chrome

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2+
## 7.4.3-dev
3+
4+
* update dependency range on analyzer
5+
* update dependency range on test
6+
* fix broken test caused by dart 2's new asyc behavior
7+
8+
## 7.4.2
9+
10+
* add lint ignores to generated files
11+
112
## 7.4.1-dev
213

314
* open sourc-gen range

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ Inspired by [redux][redux_git]
4040
4141
Built using [built_value][built_value_git]
4242
43+
## Using dart 2?
44+
Check out the [dart 2 dev branch](https://github.com/davidmarne/built_redux/tree/dart-2-dev), which works with the latest versions of build, build_runner, and built_value.
45+
4346
## Framework bindings
4447
4548
[flutter]

doc/basics/reducers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ I can define a simple reducer function as follows:
3232

3333
```dart
3434
void counterReducer(App prevState, Action<dynamic> action, AppBuilder builder) {
35-
if (action.name == AppActionNames.increment.name)
35+
if (action.name == AppActionsNames.increment.name)
3636
builder.count += action.payload as int;
37-
else if (action.name == AppActionNames.decrement.name)
37+
else if (action.name == AppActionsNames.decrement.name)
3838
builder.count -= action.payload as int;
3939
}
4040
```

example/example.g.dart

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/generator.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ class BuiltReduxGenerator extends Generator {
88
@override
99
Future<String> generate(LibraryReader library, BuildStep buildStep) async {
1010
final result = new StringBuffer();
11+
var hasWrittenHeaders = false;
1112
for (final element in library.allElements) {
1213
if (_needsReduxActions(element) && element is ClassElement) {
14+
if (!hasWrittenHeaders) {
15+
hasWrittenHeaders = true;
16+
result.writeln(_lintIgnores);
17+
}
1318
log.info('Generating action classes for ${element.name}');
1419
result.writeln(_generateActions(element));
1520
}
@@ -19,6 +24,11 @@ class BuiltReduxGenerator extends Generator {
1924
}
2025
}
2126

27+
const _lintIgnores = """
28+
// ignore_for_file: avoid_classes_with_only_static_members
29+
// ignore_for_file: annotate_overrides
30+
""";
31+
2232
String _generateActions(ClassElement element) =>
2333
_generateDispatchersIfNeeded(element) + _actionNamesClassTemplate(element);
2434

lib/src/store.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ class Store<
4343
if (_state == state) return;
4444

4545
// update the internal state and publish the change
46-
_stateController.add(
47-
new StoreChange<State, StateBuilder, dynamic>(state, _state, action));
46+
if (!_stateController.isClosed)
47+
_stateController.add(new StoreChange<State, StateBuilder, dynamic>(
48+
state, _state, action));
49+
4850
_state = state;
4951
};
5052

pubspec.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
name: built_redux
2-
version: 7.4.1-dev
2+
version: 7.4.3-dev
33
description:
44
A state management library written in dart that enforces immutability
55
authors:
66
- David Marne <[email protected]>
77
homepage: https://github.com/davidmarne/built_redux
88
dependencies:
9-
analyzer: '>=0.29.0 <0.32.0'
9+
analyzer: '>=0.29.0 <0.33.0'
1010
build: ^0.12.0
1111
built_collection: '>=1.0.0 <4.0.0'
1212
built_value: ^5.2.0
1313
built_value_generator: ^5.2.0
1414
source_gen: '>=0.7.0 <0.9.0'
15-
test: ^0.12.0
15+
test: '>=0.12.0 <2.0.0'
1616

1717
dev_dependencies:
18-
build_runner: ^0.8.0
18+
build_runner: ^0.9.0
1919
build_test: ^0.10.0
20-
build_web_compilers: ^0.3.6
21-
dart_dev: ^1.9.2
22-
dart_style: ^1.0.0
23-
coverage: ^0.11.0
20+
build_web_compilers: ^0.4.0
2421

2522
environment:
26-
sdk: '>=2-0-0-dev <2.0.0'
23+
sdk: '>=2-0-0-dev <2.0.0'

test/unit/action_generics_models.g.dart

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)