Stop calling top level pub (#89032)

* Use `dart __deprecated_pub` instead of `pub` to invoke pub from tools

The top level `pub` commmand has been deprecated and will print
a message. It is however implemented via the __deprecated_pub command
that prints no message.
This commit is contained in:
Sigurd Meldgaard
2021-08-30 19:40:10 +02:00
committed by GitHub
parent 0b41698cc6
commit bce366203a
16 changed files with 133 additions and 104 deletions

View File

@@ -24,7 +24,6 @@ SET engine_version_path=%FLUTTER_ROOT%\bin\internal\engine.version
SET pub_cache_path=%FLUTTER_ROOT%\.pub-cache
SET dart=%dart_sdk_path%\bin\dart.exe
SET pub=%dart_sdk_path%\bin\pub.bat
REM Detect which PowerShell executable is available on the Host
REM PowerShell version <= 5: PowerShell.exe
@@ -139,7 +138,7 @@ GOTO :after_subroutine
SET /A remaining_tries=%total_tries%-1
:retry_pub_upgrade
ECHO Running pub upgrade... 1>&2
CALL "%pub%" upgrade "%VERBOSITY%" --no-precompile
"%dart%" __deprecated_pub upgrade "%VERBOSITY%" --no-precompile
IF "%ERRORLEVEL%" EQU "0" goto :upgrade_succeeded
ECHO Error (%ERRORLEVEL%): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (%remaining_tries% tries left) 1>&2
timeout /t 5 /nobreak 2>NUL

View File

@@ -21,7 +21,7 @@ function retry_upgrade {
local total_tries="10"
local remaining_tries=$((total_tries - 1))
while [[ "$remaining_tries" -gt 0 ]]; do
(cd "$FLUTTER_TOOLS_DIR" && "$PUB" upgrade "$VERBOSITY" --no-precompile) && break
(cd "$FLUTTER_TOOLS_DIR" && "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile) && break
>&2 echo "Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... ($remaining_tries tries left)"
remaining_tries=$((remaining_tries - 1))
sleep 5
@@ -180,14 +180,12 @@ function shared::execute() {
DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
DART="$DART_SDK_PATH/bin/dart"
PUB="$DART_SDK_PATH/bin/pub"
# If running over git-bash, overrides the default UNIX executables with win32
# executables
case "$(uname -s)" in
MINGW*)
DART="$DART.exe"
PUB="$PUB.bat"
;;
esac