Writing this thing because its a pain setting up the repo + the docs are outdated.
- Make sure that you don’t have any flutter executable in your PATH.
Install python3
git
depot_toolsVisual Studio 2017
Windows 10 SDK` (required for non-Googlers only). Make sure to install the “Debugging Tools for Windows” feature.git clone https://github.com/flutter/flutter.git
cd flutter
git remote rename origin upstream
Fork flutter and change the origin to your fork:
git remote add origin [email protected]:\
/flutter.git Add flutter/bin to PATH.
- make sure flutter is in your PATH
where.exe flutter
you'd might need to restart your terminal
Setting up the engine development environment
- Add these to your env vars:
DEPOT_TOOLS_WIN_TOOLCHAIN=0
-
GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community
(make sure the path is correct)
- cd flutter/engine
- cp
.\scripts\standard.gclient
../.gclient
copy to root folder (before engine) -
cd ../
and rungclient sync
- Flutter has a tool for building the engine called
et
. Add it to PATH:C:\Users\temp\Desktop\flutter\engine\src\flutter\bin
- cd into
flutter/engine
and runet build
to build the engine. (make sureet
is in your PATH) - Go make some ☕️ 🕐
- In the mean time, you can configure your VS Code C++ LSP. I suggest that you first disable Dart and Flutter extensions in order to avoid them running commands you don’t want.
- What should be done is:
- Open Code in
flutter/engine
and make sure you have thems-vscode.cpptools
extension installed. - Configure VS Code to use
compile_commands.json
, which should be inC:\Users\temp\Desktop\flutter\engine\src\out\host_debug
.
- Open Code in
- After several years et build should finish successfully, if not, don't start making changes you'd regret that later.
- Implement your patches and create a PR on Flutter. Remember that Flutter's team requires signed commits… ___ ### Running Flutter projects with your custom engine
as per flutter docs on GH you should use et run inside your project (as if it was flutter run ) although for some reason it didn't worked for me, so I instead ran the et tool directly like so
ps
dart C:\Users\temp\Desktop\flutter\engine\src\flutter\tools\engine_tool\bin\et.dart run