-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from davidmarne/dart-2-dev
Dart 7.4.5 - Dart 2
- Loading branch information
Showing
20 changed files
with
512 additions
and
439 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
language: dart | ||
dart: | ||
- stable | ||
dart: dev | ||
sudo: required | ||
addons: | ||
chrome: stable | ||
before_install: | ||
- export DISPLAY=:99.0 | ||
- sh -e /etc/init.d/xvfb start | ||
- "t=0; until (xdpyinfo -display :99 &> /dev/null || test $t -gt 10); do sleep 1; let t=$t+1; done" | ||
|
||
script: | ||
- dart tool/build.dart | ||
- pub run dart_dev format --check | ||
- pub run dart_dev analyze | ||
- pub run dart_dev test -p vm | ||
- pub run dart_dev coverage --no-html | ||
- bash <(curl -s https://codecov.io/bash) -f coverage/coverage.lcov | ||
- pub run build_runner build --delete-conflicting-outputs | ||
- dartfmt -n --set-exit-if-changed lib/ | ||
- dartanalyzer --fatal-warnings --fatal-infos lib/ | ||
- pub run build_runner test --delete-conflicting-outputs | ||
- pub run build_runner test --delete-conflicting-outputs -- -p chrome |
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,15 @@ | ||
targets: | ||
$default: | ||
builders: | ||
built_redux|built_redux: | ||
enabled: true | ||
|
||
builders: | ||
built_redux: | ||
target: ":built_redux" | ||
import: "package:built_redux/builder.dart" | ||
builder_factories: ["builtRedux"] | ||
build_extensions: {".dart": [".built_redux.g.part"]} | ||
auto_apply: dependents | ||
build_to: cache | ||
applies_builders: ["source_gen|combining_builder"] |
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,40 +1,16 @@ | ||
# Setup | ||
|
||
built_value and built_redux both rely on code generation. | ||
built_value and built_redux both rely on build_runner for code generation. | ||
|
||
1. Add the `built_redux` package as a dependency in your `pubspec.yaml`. | ||
|
||
```yaml | ||
dependencies: | ||
built_redux: ^7.0.0 | ||
built_value: ^5.0.0 | ||
built_redux: ^7.4.5 | ||
built_value: '>=5.5.5 <7.0.0' | ||
dev_dependencies: | ||
build_runner: ^0.6.0 | ||
built_value_generator: '>=4.1.0 < 6.0.0' | ||
source_gen: ^0.7.0 | ||
build_runner: ^0.9.0 | ||
built_value_generator: ^6.0.0 | ||
``` | ||
2. Create a script to run generators for generating built_values and built_redux action classes. | ||
```dart | ||
import 'dart:async'; | ||
|
||
import 'package:build_runner/build_runner.dart'; | ||
import 'package:built_value_generator/built_value_generator.dart'; | ||
import 'package:source_gen/source_gen.dart'; | ||
import 'package:built_redux/generator.dart'; | ||
|
||
Future main(List<String> args) async { | ||
await build([ | ||
new BuildAction( | ||
new PartBuilder([ | ||
new BuiltValueGenerator(), | ||
new BuiltReduxGenerator(), | ||
]), | ||
// your lib name here | ||
'built_redux', | ||
// tweak the files that invoke the generator here | ||
inputs: const ['lib/**/*.dart']) | ||
], deleteFilesByDefault: true); | ||
} | ||
``` | ||
|
||
3. Run the build script from the command line to generate your built_values and built_redux action classes by running `dart [build script name].dart` | ||
2. Use build runner to build the generated files by executing `pub run build_runner build` |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,8 @@ | ||
import 'package:build/build.dart'; | ||
import 'package:source_gen/source_gen.dart'; | ||
|
||
import 'generator.dart'; | ||
|
||
Builder builtRedux(BuilderOptions _) => new SharedPartBuilder([ | ||
new BuiltReduxGenerator(), | ||
], 'built_redux'); |
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 |
---|---|---|
@@ -1,28 +1,23 @@ | ||
name: built_redux | ||
version: 7.4.2 | ||
version: 7.4.5 | ||
description: | ||
A state management library written in dart that enforces immutability | ||
authors: | ||
- David Marne <davemarne@gmail.com> | ||
homepage: https://github.com/davidmarne/built_redux | ||
dependencies: | ||
analyzer: '>=0.29.0 <0.32.0' | ||
build: '>=0.10.0 <0.12.0' | ||
built_collection: '>=1.0.0 <4.0.0' | ||
built_value: '>=4.1.0 < 6.0.0' | ||
source_gen: ^0.7.0 | ||
test: ^0.12.0 | ||
analyzer: ^0.32.1 | ||
build: ^0.12.0 | ||
built_collection: '>=2.0.0 <4.0.0' | ||
built_value: '>=5.5.5 <7.0.0' | ||
source_gen: ^0.9.0 | ||
test: '>=0.12.0 <2.0.0' | ||
|
||
dev_dependencies: | ||
build_runner: ^0.6.0 | ||
built_value_generator: ^5.0.0 | ||
dart_dev: ^1.9.2 | ||
dart_style: ^1.0.0 | ||
coverage: ^0.9.3 | ||
build_runner: ^0.10.0 | ||
build_test: ^0.10.0 | ||
built_value_generator: ^6.0.0 | ||
build_web_compilers: ^0.4.0 | ||
|
||
environment: | ||
sdk: ">=1.17.1 <2.0.0" | ||
|
||
transformers: | ||
- test/pub_serve: | ||
$include: test/**_test{.*,}.dart | ||
sdk: '>=2.0.0-dev <3.0.0' |
Oops, something went wrong.