You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have previously built the engine (i.e. your environment is already setup) and just want a refresher, then feel free to skip to one of the following sections:
10
20
@@ -35,7 +45,7 @@ Getting the code and configuring your environment
35
45
-------------------------------------------------
36
46
37
47
* Ensure all the dependencies described in the previous section, in particular git, ssh, depot_tools, python, and curl, are installed.
38
-
* Fork `https://github.com/flutter/engine` into your own GitHub account. If you already have a fork, and are now installing a development environment on a new machine, make sure you've updated your fork so that you don't use stale configuration options from long ago.
48
+
* Fork `https://github.com/flutter/engine` into your own GitHub account. If you already have a fork, and are now installing a development environment on a new machine, make sure you've updated your fork so that you don't use stale configuration options from long ago. Do not use `git clone` to check out this repository; `gclient` will do it for you.
39
49
* If you haven't configured your machine with an SSH key that's known to github then
40
50
follow the directions here: https://help.github.com/articles/generating-ssh-keys/.
41
51
* Create an empty directory for your copy of the repository. For best results, call it `engine`: some of the tools assume this name when working across repositories. (They can be configured to use other names too, so this isn't a strict requirement.)
@@ -56,7 +66,7 @@ solutions = [
56
66
```
57
67
58
68
*`cd engine` (Change to the directory in which you put the `.gclient` file.)
59
-
*`gclient sync` This will fetch all the source code that Flutter depends on. Avoid interrupting this script, it can leave your repository in an inconsistent state that is tedious to clean up.
69
+
*`gclient sync` This will fetch all the source code that Flutter depends on. Avoid interrupting this script, it can leave your repository in an inconsistent state that is tedious to clean up. (This step automatically runs `git clone`, among other things.)
60
70
*`cd src/flutter` (Change to the `flutter` directory of the `src` directory that `gclient sync` created in your `engine` directory.)
61
71
*`git remote add upstream [email protected]:flutter/engine.git` (So that you fetch from the master `flutter/engine` repository, not your clone, when running `git fetch` et al.)
62
72
*`cd ..` (Return to the `src` directory that `gclient sync` created in your `engine` directory.)
@@ -93,10 +103,22 @@ Depending on the platform you choose below, you will need to replace `host_debug
93
103
94
104
Run the following steps, from the `src` directory created in the steps above:
95
105
96
-
*`git pull upstream master` in `src/flutter` to update the Flutter Engine repo.
97
-
*`gclient sync` to update your dependencies.
98
-
*`./flutter/tools/gn --android --unoptimized` to prepare your build files (or `--android --android-cpu [x86|x64] --unoptimized` for x86/x64 emulators) .
99
-
*`ninja -C out/android_debug_unopt` to actually build the Android binary (or `out/android_debug_unopt_x64` for x86/x64 emulators).
106
+
* Update the Flutter Engine repo.
107
+
*`git pull upstream master` in `src/flutter`
108
+
* Update your dependencies
109
+
*`gclient sync`
110
+
* Prepare your build files
111
+
*`./flutter/tools/gn --android --unoptimized` for device-side executables
112
+
*`./flutter/tools/gn --android --android-cpu x86 --unoptimized` for x86 emulators
113
+
*`./flutter/tools/gn --android --android-cpu x64 --unoptimized` for x64 emulators
114
+
*`./flutter/tools/gn --unoptimized` for host-side executables
115
+
* Build your executables
116
+
*`ninja -C out/android_debug_unopt` for device-side executables
117
+
*`ninja -C out/android_debug_unopt_x86` for x86 emulators
118
+
*`ninja -C out/android_debug_unopt_x64` for x64 emulators
119
+
*`ninja -C out/host_debug_unopt` for host-side executables
120
+
* These commands can be combined. Ex: `ninja -C out/android_debug_unopt && ninja -C out/host_debug_unopt`
121
+
* For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma.
100
122
101
123
This builds a debug-enabled ("unoptimized") binary configured to run Dart in
102
124
checked mode ("debug"). There are other versions, [discussed on the wiki](https://github.com/flutter/flutter/wiki/Flutter's-modes).
@@ -137,10 +159,12 @@ to test the engine.
137
159
* Make sure you have Xcode 9.0+ installed.
138
160
*`git pull upstream master` in `src/flutter` to update the Flutter Engine repo.
139
161
*`gclient sync` to update dependencies.
140
-
*`./flutter/tools/gn --ios --unoptimized` to prepare build files (or `--ios --simulator --unoptimized` for simulator).
162
+
*`./flutter/tools/gn --ios --unoptimized` to prepare build files for device-side executables (or `--ios --simulator --unoptimized` for simulator).
141
163
* For a discussion on the various flags and modes, [read this discussion](https://github.com/flutter/flutter/wiki/Flutter's-modes).
142
164
* This also produces an Xcode project for working with the engine source code at `out/ios_debug_unopt`
143
-
*`ninja -C out/ios_debug_unopt` to build iOS artifacts (or `out/ios_debug_sim_unopt` for simulator).
165
+
*`./flutter/tools/gn --unoptimized` to prepare the build files for host-side executables.
166
+
*`ninja -C out/ios_debug_unopt && ninja -C out/host_debug_unopt` to build all artifacts (use `out/ios_debug_sim_unopt` for Simulator).
167
+
* For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma.
144
168
145
169
Once the artifacts are built, you can start using them in your application by following these steps:
146
170
*`cd /path/to/flutter/examples/hello_world`
@@ -151,15 +175,18 @@ Once the artifacts are built, you can start using them in your application by fo
151
175
152
176
### Desktop (Mac and Linux), for tests
153
177
178
+
To run the tests, you should first clone [the main Flutter repository](https://github.com/flutter/flutter).
179
+
See [the instructions for contributing](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md)
180
+
to the main Flutter repository for detailed instructions. By default, Flutter will use the bundled version
181
+
of the engine. Follow the next steps to run tests using the locally-built engine:
182
+
154
183
*`git pull upstream master` in `src/flutter` to update the Flutter Engine repo.
155
184
*`gclient sync` to update your dependencies.
156
185
*`./flutter/tools/gn --unoptimized` to prepare your build files.
157
186
*`ninja -C out/host_debug_unopt` to build a desktop unoptimized binary.
187
+
* For Googlers, consider also using the option `-j 1000` to parallelize the build using Goma.
158
188
*`--unoptimized` disables C++ compiler optimizations and does not strip debug symbols. You may skip the flag and invoke `ninja -C out/host_debug` if you would rather have the native components optimized.
159
-
160
-
To run the tests, you'll also need to clone [the main Flutter repository](https://github.com/flutter/flutter).
161
-
See [the instructions for contributing](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md)
162
-
to the main Flutter repository for detailed instructions.
189
+
*`flutter test --local-engine=host_debug_unopt` will run tests using the locally-built `flutter_tester`.
0 commit comments