You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: bin/internal/shared.sh
+14-16Lines changed: 14 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ set -e
17
17
# Needed because if it is set, cd may print the path it changed to.
18
18
unset CDPATH
19
19
20
-
functionretry_upgrade {
20
+
functionpub_upgrade_with_retry {
21
21
local total_tries="10"
22
22
local remaining_tries=$((total_tries -1))
23
23
while [[ "$remaining_tries"-gt 0 ]];do
@@ -115,45 +115,48 @@ function upgrade_flutter () (
115
115
mkdir -p "$FLUTTER_ROOT/bin/cache"
116
116
117
117
local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)"
118
+
local compilekey="$revision:$FLUTTER_TOOL_ARGS"
118
119
119
120
# Invalidate cache if:
120
121
# * SNAPSHOT_PATH is not a file, or
121
-
# * STAMP_PATH is not a file with nonzero size, or
122
-
# * Contents of STAMP_PATH is not our local git HEAD revision, or
122
+
# * STAMP_PATH is not a file, or
123
+
# * STAMP_PATH is an empty file, or
124
+
# * Contents of STAMP_PATH is not what we are going to compile, or
123
125
# * pubspec.yaml last modified after pubspec.lock
124
-
if [[ !-f"$SNAPSHOT_PATH"||!-s"$STAMP_PATH"||"$(cat "$STAMP_PATH")"!="$revision"||"$FLUTTER_TOOLS_DIR/pubspec.yaml"-nt"$FLUTTER_TOOLS_DIR/pubspec.lock" ]];then
126
+
if [[ !-f"$SNAPSHOT_PATH"||!-s"$STAMP_PATH"||"$(cat "$STAMP_PATH")"!="$compilekey"||"$FLUTTER_TOOLS_DIR/pubspec.yaml"-nt"$FLUTTER_TOOLS_DIR/pubspec.lock" ]];then
125
127
# Waits for the update lock to be acquired. Placing this check inside the
126
128
# conditional allows the majority of flutter/dart installations to bypass
127
129
# the lock entirely, but as a result this required a second verification that
128
130
# the SDK is up to date.
129
131
_wait_for_lock
130
132
131
133
# A different shell process might have updated the tool/SDK.
132
-
if [[ -f"$SNAPSHOT_PATH"&&-s"$STAMP_PATH"&&"$(cat "$STAMP_PATH")"=="$revision"&&"$FLUTTER_TOOLS_DIR/pubspec.yaml"-ot"$FLUTTER_TOOLS_DIR/pubspec.lock" ]];then
134
+
if [[ -f"$SNAPSHOT_PATH"&&-s"$STAMP_PATH"&&"$(cat "$STAMP_PATH")"=="$compilekey"&&"$FLUTTER_TOOLS_DIR/pubspec.yaml"-ot"$FLUTTER_TOOLS_DIR/pubspec.lock" ]];then
133
135
exit$?
134
136
fi
135
137
138
+
# Fetch Dart...
136
139
rm -f "$FLUTTER_ROOT/version"
137
140
touch "$FLUTTER_ROOT/bin/cache/.dartignore"
138
141
"$FLUTTER_ROOT/bin/internal/update_dart_sdk.sh"
139
-
VERBOSITY="--verbosity=error"
140
142
141
143
>&2echo Building flutter tool...
144
+
145
+
# Prepare packages...
146
+
VERBOSITY="--verbosity=error"
142
147
if [[ "$CI"=="true"||"$BOT"=="true"||"$CONTINUOUS_INTEGRATION"=="true"||"$CHROME_HEADLESS"=="1" ]];then
0 commit comments