Skip to content

Commit 5992d67

Browse files
Merge pull request #1 from flutter/master
merge
2 parents 2114a88 + 1770f88 commit 5992d67

File tree

1,379 files changed

+52188
-195740
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,379 files changed

+52188
-195740
lines changed

.cirrus.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
gcp_credentials: ENCRYPTED[987a78af29b91ce8489594c9ab3fec21845bbe5ba68294b8f6def3cf0d380830f06687a89ea69c87344c5ade369700fe]
2+
3+
gke_container:
4+
image: gcr.io/flutter-cirrus/build-engine-image:latest
5+
cluster_name: build-32-cluster
6+
zone: us-central1-a
7+
namespace: default
8+
cpu: 30 # can't use all 30-cores; system pods needs cores too
9+
memory: 100Gb # similarly, can't use all 100Gb memory
10+
11+
task:
12+
env:
13+
CIRRUS_WORKING_DIR: "/tmp/github_repo"
14+
15+
replace_engine_script: |
16+
cd $ENGINE_PATH/src
17+
rm -r flutter
18+
mv $CIRRUS_WORKING_DIR flutter
19+
gclient sync
20+
21+
matrix:
22+
- name: build_host
23+
compile_host_script: |
24+
cd $ENGINE_PATH/src
25+
./flutter/tools/gn --unoptimized
26+
ninja -C out/host_debug_unopt
27+
- name: build_android
28+
compile_host_script: |
29+
cd $ENGINE_PATH/src
30+
./flutter/tools/gn --android --unoptimized
31+
ninja -C out/android_debug_unopt
32+
33+
format_and_dart_test_task:
34+
container:
35+
image: gcr.io/flutter-cirrus/build-engine-image:latest
36+
37+
env:
38+
CIRRUS_WORKING_DIR: "/tmp/github_repo"
39+
40+
replace_engine_script: |
41+
cd $ENGINE_PATH/src
42+
rm -r flutter
43+
cp $CIRRUS_WORKING_DIR -r ./flutter
44+
gclient sync
45+
46+
format_script: cd $ENGINE_PATH/src/flutter && ./ci/format.sh
47+
build_script: cd $ENGINE_PATH/src/flutter && ./ci/build.sh
48+
test_script: cd $ENGINE_PATH/src/flutter && ./ci/test.sh

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.DS_Store
66
.classpath
77
.cproject
8+
.dart_tool
89
.gdb_history
910
.checkstyle
1011
.gdbinit

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

AUTHORS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@ Google Inc.
77
Jim Simon <[email protected]>
88
Ali Bitek <[email protected]>
99
Jacob Greenfield <[email protected]>
10+
Dan Field <[email protected]>
11+
Victor Choueiri <[email protected]>
12+
Simon Lightfoot <[email protected]>
13+
Dwayne Slater <[email protected]>
14+
Tetsuhiro Ueda <[email protected]>

BUILD.gn

Lines changed: 20 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ group("flutter") {
1010
public_deps = [
1111
"$flutter_root/lib/snapshot:generate_snapshot_bin",
1212
"$flutter_root/lib/snapshot:kernel_platform_files",
13+
"$flutter_root/shell/platform/embedder:flutter_engine",
1314
"$flutter_root/sky",
14-
"$flutter_root/third_party/txt",
1515
]
1616

17-
if (flutter_runtime_mode != "debug") {
18-
public_deps += [
19-
"$flutter_root/lib/snapshot:entry_points_json_files",
20-
]
17+
if (current_toolchain == host_toolchain) {
18+
public_deps += [ "$flutter_root/shell/testing" ]
19+
}
20+
21+
if (flutter_runtime_mode != "debug" &&
22+
flutter_runtime_mode != "dynamic_profile" &&
23+
flutter_runtime_mode != "dynamic_release") {
24+
public_deps += [ "$flutter_root/lib/snapshot:entry_points_json_files" ]
2125
}
2226

2327
if (!is_fuchsia && !is_fuchsia_host) {
@@ -29,35 +33,21 @@ group("flutter") {
2933
}
3034
}
3135

32-
if (is_fuchsia) {
33-
public_deps += [
34-
"$flutter_root/content_handler:aot",
35-
"$flutter_root/content_handler:jit",
36-
"$flutter_root/flow",
37-
]
38-
}
39-
4036
# If on the host, compile all unittests targets.
4137
if (current_toolchain == host_toolchain) {
4238
if (is_mac) {
43-
public_deps += [
44-
"$flutter_root/shell/platform/darwin:flutter_channels_unittests",
45-
"$flutter_root/shell/platform/embedder:flutter_embedder_framework",
46-
]
47-
}
48-
if (!is_win) {
49-
public_deps += [
50-
"$flutter_root/shell/platform/embedder:embedder_unittests",
51-
"$flutter_root/shell/platform/embedder:flutter_engine",
52-
]
39+
public_deps +=
40+
[ "$flutter_root/shell/platform/darwin:flutter_channels_unittests" ]
5341
}
42+
5443
public_deps += [
5544
"$flutter_root/flow:flow_unittests",
5645
"$flutter_root/fml:fml_unittests",
57-
"$flutter_root/sky/engine/wtf:wtf_unittests",
46+
"$flutter_root/runtime:runtime_unittests",
47+
"$flutter_root/shell/common:shell_unittests",
48+
"$flutter_root/shell/platform/embedder:embedder_unittests",
5849
"$flutter_root/synchronization:synchronization_unittests",
5950
"$flutter_root/third_party/txt:txt_unittests",
60-
"//garnet/public/lib/fxl:fxl_unittests",
6151
]
6252
}
6353
}
@@ -66,74 +56,10 @@ config("config") {
6656
include_dirs = [ ".." ]
6757
}
6858

69-
if (is_fuchsia) {
70-
import("//build/package.gni")
71-
72-
package("flutter_aot_runner") {
73-
deps = [
74-
"$flutter_root/content_handler:aot",
75-
]
76-
if (flutter_runtime_mode != "release") {
77-
deps += [
78-
"//third_party/dart/runtime/observatory:embedded_archive_observatory",
79-
]
80-
}
81-
82-
binary = "flutter_aot_runner"
83-
84-
if (flutter_runtime_mode != "release") {
85-
resources = [
86-
{
87-
path = rebase_path(
88-
"$root_gen_dir/observatory/embedded_archive_observatory.tar")
89-
dest = "observatory.tar"
90-
},
91-
]
92-
}
93-
94-
meta = [
95-
{
96-
path = rebase_path("content_handler/meta/sandbox")
97-
dest = "sandbox"
98-
},
99-
]
100-
}
101-
102-
package("flutter_jit_runner") {
103-
deps = [
104-
"$flutter_root/content_handler:jit",
105-
]
106-
if (flutter_runtime_mode != "release") {
107-
deps += [
108-
"//third_party/dart/runtime/observatory:embedded_archive_observatory",
109-
]
110-
}
111-
112-
binary = "flutter_jit_runner"
113-
114-
if (flutter_runtime_mode != "release") {
115-
resources = [
116-
{
117-
path = rebase_path(
118-
"$root_gen_dir/observatory/embedded_archive_observatory.tar")
119-
dest = "observatory.tar"
120-
},
121-
]
122-
}
123-
124-
meta = [
125-
{
126-
path = rebase_path("content_handler/meta/sandbox")
127-
dest = "sandbox"
128-
},
129-
]
130-
}
131-
} else {
132-
group("dist") {
133-
testonly = true
59+
group("dist") {
60+
testonly = true
13461

135-
deps = [
136-
"$flutter_root/sky/dist",
137-
]
138-
}
62+
deps = [
63+
"$flutter_root/sky/dist",
64+
]
13965
}

CONTRIBUTING.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
Contributing to the Flutter engine
22
==================================
33

4-
[![Build Status](https://travis-ci.org/flutter/engine.svg)](https://travis-ci.org/flutter/engine)
4+
[![Build Status](https://cirrus-ci.com/flutter/engine.svg)](https://cirrus-ci.com/flutter/engine)
5+
6+
_See also: [Flutter's code of conduct](https://flutter.io/design-principles/#code-of-conduct)_
7+
8+
Welcome
9+
-------
10+
11+
This guide introduces you to building and contributing to the Flutter engine.
12+
For an introduction to contributing to the Flutter framework, see [the equivalent
13+
document in the framework's repository](https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md).
14+
515

616
I built it before. Remind me, how do I do it again?
7-
--------------------
17+
---------------------------------------------------
818

919
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:
1020

@@ -35,7 +45,7 @@ Getting the code and configuring your environment
3545
-------------------------------------------------
3646

3747
* 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.
3949
* If you haven't configured your machine with an SSH key that's known to github then
4050
follow the directions here: https://help.github.com/articles/generating-ssh-keys/.
4151
* 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 = [
5666
```
5767

5868
* `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.)
6070
* `cd src/flutter` (Change to the `flutter` directory of the `src` directory that `gclient sync` created in your `engine` directory.)
6171
* `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.)
6272
* `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
93103

94104
Run the following steps, from the `src` directory created in the steps above:
95105

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.
100122

101123
This builds a debug-enabled ("unoptimized") binary configured to run Dart in
102124
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.
137159
* Make sure you have Xcode 9.0+ installed.
138160
* `git pull upstream master` in `src/flutter` to update the Flutter Engine repo.
139161
* `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).
141163
* For a discussion on the various flags and modes, [read this discussion](https://github.com/flutter/flutter/wiki/Flutter's-modes).
142164
* 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.
144168

145169
Once the artifacts are built, you can start using them in your application by following these steps:
146170
* `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
151175

152176
### Desktop (Mac and Linux), for tests
153177

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+
154183
* `git pull upstream master` in `src/flutter` to update the Flutter Engine repo.
155184
* `gclient sync` to update your dependencies.
156185
* `./flutter/tools/gn --unoptimized` to prepare your build files.
157186
* `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.
158188
* `--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`.
163190

164191
### Desktop (gen_snapshot for Windows)
165192

@@ -200,7 +227,8 @@ find . -mindepth 1 -maxdepth 1 -type d | xargs -n 1 sh -c 'ninja -C $0 || exit 2
200227
Contributing code
201228
-----------------
202229

203-
We gladly accept contributions via GitHub pull requests.
230+
We gladly accept contributions via GitHub pull requests. See [the wiki](https://github.com/flutter/engine/wiki) for
231+
information about the engine's architecture.
204232

205233
To start working on a patch:
206234

0 commit comments

Comments
 (0)