一、编译Flutter Engine
创建工作目录 engine
添加 depot_tools 到环境变量,并在engine目录下创建.gclient文件
1
2
3
4
5
6
7
8
9
10solutions = [
{
"managed": False,
"name": "src/flutter",
"url": "[email protected]:<your_name_here>/engine.git",
"custom_deps": {},
"deps_file": "DEPS",
"safesync_url": "",
},
]在engine目录执行
gclient sync
命令同步源码和编译工具链进入
engine/src
目录下,如果是linux平台执行:1
2
3
4sudo ./build/install-build-deps-android.sh
sudo ./build/install-build-deps.sh
sudo ./flutter/build/install-build-deps-linux-desktop.sh如果是mac平台,安装jdk 1.8 和ant:
1
brew install ant
在
engine/src
目录下,生成编译配置文件1
./flutter/tools/gn --android --unoptimized
生成目录
engine/src/out/android_debug_unopt
在
engine/src
目录下,执行编译命令1
ninja -C out/android_debug_unopt