README.md
1# Flutter Tools
2
3Command line developer tools for building Flutter applications.
4
5## Working on Flutter Tools
6
7Be sure to follow the instructions on [CONTRIBUTING.md](../../CONTRIBUTING.md)
8to set up your development environment.
9
10### Setup
11
12First, ensure that the Dart SDK and other necessary artifacts are available by
13invoking the Flutter Tools wrapper script. In this directory run:
14```shell
15$ ../../bin/flutter --version
16```
17
18### Running
19
20To run Flutter Tools from source, in this directory run:
21```shell
22$ ../../bin/cache/dart-sdk/bin/dart bin/flutter_tools.dart
23```
24followed by command line arguments, as usual.
25
26### Analyzing
27
28To run the analyzer on Flutter Tools, in this directory run:
29```shell
30$ ../../bin/flutter analyze
31```
32
33### Testing
34
35To run the tests in the `test/` directory, first ensure that there are no
36connected devices. Then, in this directory run:
37```shell
38$ ../../bin/cache/dart-sdk/bin/pub run test
39```
40
41The tests in `test/integration.shard` are slower to run than the tests in
42`test/general.shard`. To run only the tests in `test/general.shard`, in this
43directory run:
44```shell
45$ ../../bin/cache/dart-sdk/bin/pub run test test/general.shard
46```
47
48To run the tests in a specific file, run:
49```shell
50$ ../../bin/cache/dart-sdk/bin/pub run test test/general.shard/utils_test.dart
51```
52
53When running all of the tests, it is a bit faster to use `build_runner`. First,
54set `FLUTTER_ROOT` to the root of your Flutter checkout. Then, in this directory
55run:
56```shell
57$ ../../bin/cache/dart-sdk/bin/pub run build_runner test
58```
59
60### Forcing snapshot regeneration
61
62To force the Flutter Tools snapshot to be regenerated, delete the following
63files:
64```shell
65$ rm ../../bin/cache/flutter_tools.stamp ../../bin/cache/flutter_tools.snapshot
66```
67