Pass FLUTTER_TOOL_ARGS to snapshot command. (#29938)

This commit is contained in:
Jonah Williams 2019-03-27 15:24:08 -07:00 committed by GitHub
parent 76b9962fdd
commit 0a2175f133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View File

@ -121,7 +121,7 @@ function upgrade_flutter () {
retry_upgrade
"$DART" --snapshot="$SNAPSHOT_PATH" --snapshot-kind=app-jit --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH" training
"$DART" $FLUTTER_TOOL_ARGS --snapshot="$SNAPSHOT_PATH" --snapshot-kind=app-jit --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH" training
echo "$revision" > "$STAMP_PATH"
fi
# The exit here is duplicitous since the function is run in a subshell,

View File

@ -152,7 +152,11 @@ GOTO :after_subroutine
POPD
"%dart%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
IF "%FLUTTER_TOOL_ARGS%" == "" (
"%dart%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
) else (
"%dart%" "%FLUTTER_TOOL_ARGS%" --snapshot="%snapshot_path%" --snapshot-kind=app-jit --packages="%flutter_tools_dir%\.packages" "%script_path%"
)
IF "%ERRORLEVEL%" NEQ "0" (
ECHO Error: Unable to create dart snapshot for flutter tool.
SET exit_code=%ERRORLEVEL%

View File

@ -180,16 +180,24 @@ Future<void> _runToolTests() async {
final bq.BigqueryApi bigqueryApi = await _getBigqueryApi();
await _runSmokeTests();
// The flutter_tool will currently be snapshotted without asserts. We need
// to force it to be regenerated with them enabled.
if (!Platform.isWindows) {
File(path.join(flutterRoot, 'bin', 'cache', 'flutter_tools.snapshot')).deleteSync();
File(path.join(flutterRoot, 'bin', 'cache', 'flutter_tools.stamp')).deleteSync();
}
if (noUseBuildRunner) {
await _pubRunTest(
path.join(flutterRoot, 'packages', 'flutter_tools'),
tableData: bigqueryApi?.tabledata,
enableFlutterToolAsserts: !Platform.isWindows,
);
} else {
await _buildRunnerTest(
path.join(flutterRoot, 'packages', 'flutter_tools'),
flutterRoot,
tableData: bigqueryApi?.tabledata,
enableFlutterToolAsserts: !Platform.isWindows,
);
}