# Flutter Engine Build Definition Language
The ***Flutter Engine Build Definition Language*** describes a build on CI
by defining a combination of *sub-builds*, *archives*, *generators* and *dependencies*. It
makes it simple to shard sub-builds by mapping build inputs to workflows, and listing
the sub-build-generated artifacts explicitly. The Build Definition Language, Engine
Recipes V2 and the generation of artifacts using GN+Ninja set the groundwork
for efficient builds with dependency reusability.
## Glossary
* **[recipes](https://github.com/luci/recipes-py)** - domain specific
language for specifying sequences of subprocess calls in a cross-platform and
testable way.
* **Generator** - scripts in Dart, python or bash that combine the output of
sub-builds to generate artifacts.
* **Builder** - a combination of configuration, recipes and a given commit to
build and test artifacts.
* **Build** - a builder running with specific properties, repository and
commit.
* **[GN](https://gn.googlesource.com/gn/)** - a meta-build system that
generates build files for [Ninja](https://ninja-build.org/).
* **[Ninja](https://ninja-build.org)** - Ninja is a small build system with a
focus on speed.
* **CAS** - a service that stores arbitrary binary blobs addressed by (hash of)
their content. It is specialized for low latency, high volume query/read/write
operations.
## USAGE EXAMPLES
Engine build definition files using the Build Definition Language can be found in the
[flutter/engine/ci/builders](https://github.com/flutter/engine/tree/main/ci/builders) directory.
The [engine orchestrator recipe](https://flutter.googlesource.com/recipes/+/refs/heads/main/recipes/engine_v2/)
reads each file in that directory, shards their builds, collects artifacts and
uploads them to the Google Cloud Storage bucket.
The [.ci.yaml file](https://github.com/flutter/engine/blob/main/.ci.yaml) at the
root of the `flutter/engine` repository puts all the components together.
Builds are specified in that file using a property pointing to the build definition
file to be used by engine\_v2 recipes. Full documentation of the `.ci.yaml` file format
can be found [in the Cocoon repository here](https://github.com/flutter/cocoon/blob/main/CI_YAML.md).
The following is a sample build configuration referencing
[android\_aot\_engine.json](https://github.com/flutter/engine/blob/main/ci/builders/mac_android_aot_engine.json)
in the `config_name` under `properties`:
```yaml
- name: Mac mac_android_aot_engine
recipe: engine_v2/engine_v2
timeout: 60
properties:
config_name: mac_android_aot_engine
$flutter/osx_sdk : >-
{ "sdk_version": "15a240d" }
```
## Build Definition Language Assumptions
To keep the build definition language simple the following assumptions were
made during its design:
* A build can be expressed as a set of independent sub-builds.
* A sub-build can be defined as a sequence of a `gn` configuration step,
a `ninja` build step, followed by self-contained test scripts, and self-contained
generator scripts. All the elements are optional allowing to use gn+ninja without
generators or generators without gn+ninja.
* All the sub-builds required by a global generator are defined within the same
configuration file.
## Build configuration file
The build configuration is a json file containing a list of builds, tests,
generators and archives. The following is an example of an empty configuration
file:
```json
{
"builds": [],
"tests": [],
"generators": {
"tasks": []
},
"archives": [
]
}
```
Note: tests, generators and archives can be omited if empty.
Build configuration files have to be checked into the
[engine_checkout/ci/builder](https://github.com/flutter/engine/tree/main/ci/builders)
directory where engine v2 recipes will be reading them from.
Configurations with a single build are supported. Single build configurations
are located have to be checked into the
[engine_checkout/ci/builder/standalone](https://github.com/flutter/engine/tree/main/ci/builders/standalone)
A configuration file defines a top-level builder that will show up as a column
in the
[Flutter Dashboard](https://flutter-dashboard.appspot.com/#/build?repo=engine&branch=master).
### Magic variables
Magic variables are special environment variables that can be used as parameters
for generators and test commands in the local and global contexts.
Magic environment variables have the following limitations:
only `${FLUTTER_LOGS_DIR}` is currently supported and it needs to be used
alone within the parameter string(e.g. `["${FLUTTER_LOGS_DIR}"]` is OK
but `["path=${FLUTTER_LOGS_DIR}"]` is not).
The current list of supported magic variables is:
* `${FLUTTER_LOGS_DIR}` - translated to the path of the temporary
folder where logs are being placed.
* `${LUCI_WORKDIR}` - translated to the LUCI chroot working directory.
* `${LUCI_CLEANUP}` - translated to the LUCI chroot temp directory.
* `${REVISION}` - translated to the engine commit in postsubmit. In presubmit
it is translated to an empty string.
### Build
A build is a dictionary with a gn command, a ninja command, zero or more
generator commands, zero or more local tests, zero or more local
generators and zero or more output artifacts.
The following is the high level structure of the build component:
```json
{
"archives": [],
"drone_dimensions": [],
"gclient_variables": {},
"gn": [],
"name": "host_debug",
"generators": [],
"ninja": {},
"tests": []
"postsubmit_overrides": {}
}
```
Each build element will be translated to an independent sub-build and its
entire out directory will be uploaded to CAS.
`gn`, `ninja`, `generators`, `tests` and `postsubmit_overrides` properties are optional. Gn and
ninja properties can be used without generators or tests. Generators with
no gn and ninja properties is also supported.
#### Archives
An archive component is used to tell the recipes which artifacts are
generated by the build and where to upload them.
By default the build output is archived to CAS in order to be used
as a dependency for global tests. If no CAS archive
is required `cas_archive": false,` needs to be added to the
configuration.
```json
{
"name": "host_debug",
"base_path": "out/host_debug/zip_archives/",
"type": "gcs",
"include_paths": [
"out/host_debug/zip_archives/linux-x64/artifacts.zip"
],
"realm": "production"
}
```
Description of the fields:
* **name:** - by default the entire build output is uploaded to CAS.
`name` is used to associate the CAS hash to a value that can be referenced
later as a dependency of global tests. Name is also used to select the folder
from within src/out to upload to CAS. e.g if the build generates
src/out/host_debug name must be `host_debug`.
* **base\_path:** - the portion of the path to remove from the full path before
uploading to its final destination. In the example the above the
base\_path **“out/host\_debug/zip\_archives”** will be removed from the
include path **"out/host\_debug/zip\_archives/linux-x64/artifacts.zip"**
before uploading to GCS, e.g.
<bucket>/flutter/<commit>/linux-x64/artifacts.zip.
* **Type:** - the type of storage to use. Currently only **“gcs”** and
**“cas”** are supported. "gcs" uploads artifacts to GCS
and "cas" to archive to CAS service. Cas value is used during development where
we need to inspect the generated artifacts without worrying about location or
cleanups. Gcs is expected for any artifacts being consumed by the flutter tool.
* **Include\_paths:** - a list of strings with the paths to be uploaded to a
given destination.
* **cas_archive** - a boolean value indicating whether the build output will
be archived to CAS or not. The default value is true.
* **realm** - a string value of either `production` or `experimental`
where production means the artifact will be uploaded to the
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
engine-main.zip (2000个子文件)
app_stub.c 118B
surface.cpp 11KB
canvas.cpp 10KB
path.cpp 7KB
paragraph.cpp 6KB
image.cpp 6KB
shaders.cpp 6KB
text_style.cpp 5KB
filters.cpp 4KB
paragraph_builder.cpp 3KB
fonts.cpp 3KB
paragraph_style.cpp 3KB
line_metrics.cpp 2KB
strut_style.cpp 2KB
paint.cpp 2KB
contour_measure.cpp 2KB
picture.cpp 1KB
vertices.cpp 939B
string.cpp 921B
data.cpp 677B
line_breaker_test_raw_data.dart 1.03MB
font_fallback_data.dart 818KB
painting.dart 288KB
text.dart 143KB
text_editing_test.dart 142KB
pointer_binding_test.dart 130KB
platform_dispatcher.dart 114KB
semantics_test.dart 111KB
dom.dart 107KB
canvaskit_api.dart 97KB
semantics.dart 92KB
text_editing.dart 87KB
main.dart 80KB
platform_view.dart 73KB
patterns.dart 68KB
geometry.dart 67KB
recording_canvas.dart 60KB
path.dart 60KB
canvaskit_api_test.dart 57KB
platform_dispatcher.dart 56KB
canvas_test.dart 54KB
licenses.dart 54KB
bitmap_canvas.dart 53KB
embedded_views_test.dart 52KB
semantics.dart 48KB
window.dart 48KB
surface.dart 45KB
canvas_pool.dart 43KB
keyboard_converter_test.dart 42KB
pointer_binding.dart 41KB
build_config_runner_test.dart 39KB
text.dart 39KB
test_platform.dart 39KB
vector_math.dart 38KB
paragraph.dart 38KB
paragraph.dart 36KB
canvas_draw_image_golden_test.dart 36KB
scene_builder_test.dart 36KB
layout_service.dart 34KB
safe_browser_api.dart 34KB
compositing.dart 34KB
ui_test.dart 34KB
path_ref.dart 33KB
shader.dart 33KB
embedded_views.dart 32KB
history_test.dart 31KB
geometry.dart 30KB
picture.dart 30KB
window.dart 30KB
roll_fallback_fonts.dart 29KB
painting.dart 29KB
layout_service_plain_test.dart 29KB
fixtures.dart 28KB
recording_canvas_golden_test.dart 28KB
pointer_converter.dart 28KB
util.dart 28KB
path_metrics.dart 27KB
layout_fragmenter.dart 26KB
build_config.dart 26KB
text_golden_test.dart 26KB
filesystem.dart 26KB
build_config_runner.dart 26KB
channel_buffers.dart 26KB
layers.dart 26KB
keyboard_binding.dart 26KB
canvas_paragraph_test.dart 26KB
compositing_golden_test.dart 25KB
general_golden_test.dart 24KB
raw_keyboard_test.dart 24KB
gradient_golden_test.dart 24KB
clang_tidy_test.dart 24KB
bidi_golden_test.dart 23KB
window_test.dart 23KB
line_breaker.dart 23KB
canvas_paragraph.dart 23KB
skia_gold_client_test.dart 22KB
run_android_tests.dart 22KB
skia_gold_client.dart 22KB
key_map.g.dart 22KB
label_and_value.dart 21KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
T、ct
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- BAT偏移&合并固件用的软件包
- 红包雨-抢红包-微信小程序-项目源码
- 三相 lcl 型并网逆变器仿真, 对并网电流进行闭环 pid 控制, 系统参数有具体选取依据, 并网电流 thd=3.7%满足并
- IMG_20241009_233018.jpg
- 威伦触摸屏与MODBUD RTU 变频器通信标准程序 程序+资料+视频讲解 无需PLC RS458直连 可串多台设备 温控仪
- Mysql C++ connector 8.3
- 基于鲸鱼算法优化的lssvm回归预测:为了提高最小二乘支持向量机(lssvm)的回归预测准确率,对lssvm中的惩罚参数和核惩罚
- COMSOL仿真 无损检测-电磁检测 包括涡流检测,漏磁检测,脉冲涡流、弱磁检测,ACFM,磁记忆检测,远场涡流,电磁超声等
- gs3333333333333333
- gs222222222222222
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功