flutter_flutter/lib/web_ui/dev/felt_windows.bat
nturgut bb24b4938f
[web] Build unit tests with dart2js instead of build_runner (#20390)
* change from build_runner to dart2js

* add internalBootstrapBrowserTest to some of the tests

* add internalBootstrapBrowserTest to all remaining tests

* make tests build in paralel. Total time dropped from 586 to 177 seconds for 8 core MacBook

* change isolates with pool

* fixing analysis errors

* skipping canvaskit tests for ios-safari

* copy image files to the build directory

* adding internalBootstrapBrowserTest to newly added tests

* add internalBootstrapBrowserTest to faling path iterator test

* necessary changes to make chrome windows work

* in windows test in chrome instead of edge. our edge code was for legacy edge

* do not run golden unit tests on Windows LUCI bots for now

* addressing reviewer comments. Adding a method for deciding when to run integration tests.

* remove lines that I forgot to remove

* fixing analysis error. add issue for todo

* add bootstap to a test file

* adding bootstrap to another test

* add internalBootstrapBrowserTest to a golden test

* return test result in bat file. use archieve package to unzip

* fixing logs for chrome_installer

* use archieve and archieve entity instead of dynamic

* adding comments for windows platform archieve part

* addressing reviewer comments

* change readme file
2020-08-17 16:19:27 -07:00

72 lines
2.5 KiB
Batchfile

:: felt_windows: a command-line utility for Windows for building and testing
:: Flutter web engine.
:: FELT stands for Flutter Engine Local Tester.
@ECHO OFF
SETLOCAL
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")
SET FELT_DIR=%~dp0
:: web_ui directory is the parent of felt directory.
FOR %%a IN ("%FELT_DIR:~0,-1%") DO SET WEB_UI_DIR=%%~dpa
:: Flutter Directory is grandparent of web_ui directory.
FOR %%a IN ("%WEB_UI_DIR:~0,-1%") DO SET orTempValue=%%~dpa
FOR %%a IN ("%orTempValue:~0,-1%") DO SET FLUTTER_DIR=%%~dpa
:: Engine source directory is the parent of flutter directory.
FOR %%a IN ("%FLUTTER_DIR:~0,-1%") DO SET ENGINE_SRC_DIR=%%~dpa
SET DEV_DIR="%WEB_UI_DIR%dev"
SET OUT_DIR="%ENGINE_SRC_DIR%out"
SET HOST_DEBUG_UNOPT_DIR="%ENGINE_SRC_DIR%out\host_debug_unopt"
SET DART_SDK_DIR=%ENGINE_SRC_DIR%out\host_debug_unopt\dart-sdk
SET PUB_DIR="%DART_SDK_DIR%\bin\pub"
SET SCRIPT_PATH="%DEV_DIR%felt.dart"
SET STAMP_PATH="%DART_TOOL_DIR%felt.snapshot.stamp"
SET GN="%FLUTTER_DIR%tools\gn"
SET DART_TOOL_DIR="%WEB_UI_DIR%.dart_tool"
SET SNAPSHOT_PATH="%DART_TOOL_DIR%felt.snapshot"
:: Set revision from using git in Flutter directory.
CD %FLUTTER_DIR%
FOR /F "tokens=1 delims=:" %%a in ('git rev-parse HEAD') DO SET REVISION=%%a
:: Uncomment for debugging the values.
:: ECHO "FELT_DIR:%FELT_DIR%"
:: ECHO "WEB_UI_DIR:%WEB_UI_DIR%"
:: ECHO "FLUTTER_DIR:%FLUTTER_DIR%"
:: ECHO "ENGINE_SRC_DIR:%ENGINE_SRC_DIR%"
:: ECHO "REVISION:%REVISION%"
SET orTempValue=1
IF NOT EXIST %OUT_DIR% (SET orTempValue=0)
IF NOT EXIST %HOST_DEBUG_UNOPT_DIR% (SET orTempValue=0)
IF %orTempValue%==0 (
ECHO "Compiling the Dart SDK."
CALL gclient sync
CALL python %GN% --unoptimized --full-dart-sdk
CALL ninja -C %HOST_DEBUG_UNOPT_DIR%)
:: TODO(nurhan): The batch script does not support snanphot option.
:: Support snapshot option.
CALL :installdeps
IF %1==test (%DART_SDK_DIR%\bin\dart "%DEV_DIR%\felt.dart" %* --browser=chrome) ELSE ( %DART_SDK_DIR%\bin\dart "%DEV_DIR%\felt.dart" %* )
EXIT /B %ERRORLEVEL%
:installdeps
ECHO "Running \`pub get\` in 'engine/src/flutter/web_sdk/web_engine_tester'"
cd "%FLUTTER_DIR%web_sdk\web_engine_tester"
CALL %PUB_DIR% get
ECHO "Running \`pub get\` in 'engine/src/flutter/lib/web_ui'"
cd %WEB_UI_DIR%
CALL %PUB_DIR% get
EXIT /B 0