Run pub get before building host.dart. (flutter/engine#37502)

* Run pub get before building host.dart.

* We should call `pub get` for `web_ui` in the launcher script because
felt itself needs it. However, we should let felt invoke `pub get` on
`web_engine_tester` only as needed, not in the launcher script.
This commit is contained in:
Jackson Gardner
2022-11-11 11:00:55 -08:00
committed by GitHub
parent 733bf05ba0
commit d3a4734ede
3 changed files with 21 additions and 5 deletions

View File

@@ -87,11 +87,9 @@ then
fi
install_deps() {
# We need to run pub get here before we actually invoke felt.
echo "Running \`dart pub get\` in 'engine/src/flutter/lib/web_ui'"
(cd "$WEB_UI_DIR"; $DART_PATH pub get)
echo "Running \`dart pub get\` in 'engine/src/flutter/web_sdk/web_engine_tester'"
(cd "$FLUTTER_DIR/web_sdk/web_engine_tester"; $DART_PATH pub get)
}
if [[ $KERNEL_NAME == *"Darwin"* ]]

View File

@@ -37,13 +37,15 @@ SET DART_BIN=%DART_SDK_DIR%\bin\dart
cd %WEB_UI_DIR%
:: We need to invoke pub get here before we actually invoke felt.
CALL %DART_BIN% pub get
IF FELT_USE_SNAPSHOT=="0" (
ECHO Invoking felt.dart without snapshot
SET FELT_TARGET=%FELT_PATH%
) ELSE (
IF NOT EXIST "%SNAPSHOT_PATH%" (
ECHO Precompiling felt snapshot
CALL %DART_BIN% pub get
%DART_BIN% --snapshot="%SNAPSHOT_PATH%" --packages="%WEB_UI_DIR%\.dart_tool\package_config.json" %FELT_PATH%
)
SET FELT_TARGET=%SNAPSHOT_PATH%

View File

@@ -441,7 +441,23 @@ Future<void> buildHostPage() async {
print('Building ${hostDartFile.path}.');
}
final int exitCode = await runProcess(
int exitCode = await runProcess(
environment.dartExecutable,
<String>[
'pub',
'get',
],
workingDirectory: environment.webEngineTesterRootDir.path
);
if (exitCode != 0) {
throw ToolExit(
'Failed to run pub get for web_engine_tester, exit code $exitCode',
exitCode: exitCode,
);
}
exitCode = await runProcess(
environment.dartExecutable,
<String>[
'compile',