This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
web: improve engine dev cycle on Windows #25812
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| :: felt: a command-line utility for Windows for building and testing | ||
| :: Flutter web engine. | ||
| :: FELT stands for Flutter Engine Local Tester. | ||
|
|
||
| @ECHO OFF | ||
| SETLOCAL | ||
|
|
||
| :: Make sure gclient and ninja exist. Otherwise felt won't work. | ||
| FOR /F "tokens=1-2 delims=:" %%a in ('where gclient') DO SET GCLIENT_PATH=%%b | ||
| IF %GCLIENT_PATH%==[] (ECHO "ERROR: gclient is not in your PATH") | ||
|
|
||
| FOR /F "tokens=1-2 delims=:" %%a in ('where ninja') DO SET NINJA_PATH=%%b | ||
| IF %NINJA_PATH%==[] (ECHO "ERROR: ninja is not in your PATH") | ||
|
|
||
| :: Starting from this script's path, walk up to engine source directory. | ||
| SET SCRIPT_DIR=%~dp0 | ||
| FOR %%a IN ("%SCRIPT_DIR:~0,-1%") DO SET TMP=%%~dpa | ||
| FOR %%a IN ("%TMP:~0,-1%") DO SET TMP=%%~dpa | ||
| FOR %%a IN ("%TMP:~0,-1%") DO SET TMP=%%~dpa | ||
| FOR %%a IN ("%TMP:~0,-1%") DO SET ENGINE_SRC_DIR=%%~dpa | ||
|
|
||
| SET ENGINE_SRC_DIR=%ENGINE_SRC_DIR:~0,-1% | ||
| SET OUT_DIR=%ENGINE_SRC_DIR%\out | ||
| SET HOST_DEBUG_UNOPT_DIR=%OUT_DIR%\host_debug_unopt | ||
| SET DART_SDK_DIR=%HOST_DEBUG_UNOPT_DIR%\dart-sdk | ||
| SET DART_BIN=%DART_SDK_DIR%\bin\dart | ||
| SET PUB_BIN=%DART_SDK_DIR%\bin\pub | ||
| SET FLUTTER_DIR=%ENGINE_SRC_DIR%\flutter | ||
| SET WEB_UI_DIR=%FLUTTER_DIR%\lib\web_ui | ||
| SET DEV_DIR=%WEB_UI_DIR%\dev | ||
| SET FELT_PATH=%DEV_DIR%\felt.dart | ||
| SET DART_TOOL_DIR=%WEB_UI_DIR%\.dart_tool | ||
| SET SNAPSHOT_PATH=%DART_TOOL_DIR%\felt.snapshot | ||
|
|
||
| SET needsHostDebugUnoptRebuild=0 | ||
| for %%x in (%*) do ( | ||
| if ["%%~x"]==["--clean"] ( | ||
| ECHO Clean rebuild requested | ||
| SET needsHostDebugUnoptRebuild=1 | ||
| ) | ||
| ) | ||
|
|
||
| IF NOT EXIST %OUT_DIR% (SET needsHostDebugUnoptRebuild=1) | ||
| IF NOT EXIST %HOST_DEBUG_UNOPT_DIR% (SET needsHostDebugUnoptRebuild=1) | ||
|
|
||
| IF %needsHostDebugUnoptRebuild%==1 ( | ||
| ECHO Building host_debug_unopt | ||
| :: Delete old snapshot, if any, because the new Dart SDK may invalidate it. | ||
| IF EXIST "%SNAPSHOT_PATH%" ( | ||
| del %SNAPSHOT_PATH% | ||
| ) | ||
| CALL gclient sync -D | ||
| CALL python %GN% --unoptimized --full-dart-sdk | ||
| CALL ninja -C %HOST_DEBUG_UNOPT_DIR%) | ||
|
|
||
| cd %WEB_UI_DIR% | ||
| IF NOT EXIST "%SNAPSHOT_PATH%" ( | ||
| ECHO Precompiling felt snapshot | ||
| CALL %PUB_BIN% get | ||
| %DART_BIN% --snapshot="%SNAPSHOT_PATH%" --packages="%WEB_UI_DIR%\.packages" %FELT_PATH% | ||
| ) | ||
|
|
||
| IF %1==test ( | ||
| %DART_SDK_DIR%\bin\dart --packages="%WEB_UI_DIR%\.packages" "%SNAPSHOT_PATH%" %* --browser=chrome | ||
| ) ELSE ( | ||
| %DART_SDK_DIR%\bin\dart --packages="%WEB_UI_DIR%\.packages" "%SNAPSHOT_PATH%" %* | ||
| ) | ||
|
|
||
| EXIT /B %ERRORLEVEL% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add TODO: Update LUCI to use felt.bat and remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.