Use dart pub instead of dart __deprecated pub (#121605)

This commit is contained in:
Sigurd Meldgaard
2023-03-06 11:23:12 +01:00
committed by GitHub
parent d940ec1f76
commit 7a28078509
7 changed files with 62 additions and 42 deletions

View File

@@ -136,7 +136,6 @@ GOTO :after_subroutine
REM Makes changes to PUB_ENVIRONMENT only visible to commands within SETLOCAL/ENDLOCAL
SETLOCAL
SET VERBOSITY=--verbosity=error
IF "%CI%" == "true" GOTO on_bot
IF "%BOT%" == "true" GOTO on_bot
IF "%CONTINUOUS_INTEGRATION%" == "true" GOTO on_bot
@@ -144,8 +143,8 @@ GOTO :after_subroutine
GOTO not_on_bot
:on_bot
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_bot
SET VERBOSITY=--verbosity=normal
:not_on_bot
SET PUB_SUMMARY_ONLY=1
SET PUB_ENVIRONMENT=%PUB_ENVIRONMENT%:flutter_install
IF "%PUB_CACHE%" == "" (
IF EXIST "%pub_cache_path%" SET PUB_CACHE=%pub_cache_path%
@@ -155,7 +154,7 @@ GOTO :after_subroutine
SET /A remaining_tries=%total_tries%-1
:retry_pub_upgrade
ECHO Running pub upgrade... 1>&2
"%dart%" __deprecated_pub upgrade "%VERBOSITY%" --no-precompile
"%dart%" --no-analytics pub upgrade
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 pub_upgrade_with_retry {
local total_tries="10"
local remaining_tries=$((total_tries - 1))
while [[ "$remaining_tries" -gt 0 ]]; do
(cd "$FLUTTER_TOOLS_DIR" && "$DART" __deprecated_pub upgrade "$VERBOSITY" --no-precompile) && break
(cd "$FLUTTER_TOOLS_DIR" && "$DART" --no-analytics pub upgrade) && 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
@@ -143,10 +143,10 @@ function upgrade_flutter () (
>&2 echo Building flutter tool...
# Prepare packages...
VERBOSITY="--verbosity=error"
if [[ "$CI" == "true" || "$BOT" == "true" || "$CONTINUOUS_INTEGRATION" == "true" || "$CHROME_HEADLESS" == "1" ]]; then
PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_bot"
VERBOSITY="--verbosity=normal"
else
export PUB_SUMMARY_ONLY=1
fi
export PUB_ENVIRONMENT="$PUB_ENVIRONMENT:flutter_install"
if [[ -d "$FLUTTER_ROOT/.pub-cache" ]]; then