Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit e4fdc91

Browse files
author
Emmanuel Garcia
committed
Run pub global activate before pub global run
1 parent 9271fdd commit e4fdc91

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

.cirrus.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ task:
1414
- flutter channel master
1515
- flutter upgrade
1616
- git fetch origin master
17-
activate_script: pub global activate flutter_plugin_tools
1817
matrix:
1918
- name: publishable
2019
script:
@@ -122,7 +121,6 @@ task:
122121
- flutter channel master
123122
- flutter upgrade
124123
- git fetch origin master
125-
activate_script: pub global activate flutter_plugin_tools
126124
matrix:
127125
- name: build-linux+drive-examples
128126
install_script:
@@ -147,7 +145,6 @@ task:
147145
- flutter channel master
148146
- flutter upgrade
149147
- git fetch origin master
150-
activate_script: pub global activate flutter_plugin_tools
151148
create_simulator_script:
152149
- xcrun simctl list
153150
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
@@ -201,7 +198,6 @@ task:
201198
- flutter channel master
202199
- flutter upgrade
203200
- git fetch origin master
204-
activate_script: pub global activate flutter_plugin_tools
205201
create_simulator_script:
206202
- xcrun simctl list
207203
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
@@ -231,7 +227,6 @@ task:
231227
- flutter channel master
232228
- flutter upgrade
233229
- git fetch origin master
234-
activate_script: pub global activate flutter_plugin_tools
235230
matrix:
236231
- name: build_all_plugins_app
237232
script:

script/build_all_plugins_app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fi
6464

6565
echo "Excluding the following plugins: $ALL_EXCLUDED"
6666

67-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools all-plugins-app --exclude $ALL_EXCLUDED)
67+
(cd "$REPO_DIR" && activate_plugin_tool && pub global run flutter_plugin_tools all-plugins-app --exclude $ALL_EXCLUDED)
6868

6969
function error() {
7070
echo "$@" 1>&2

script/check_publish.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"
1111
source "$SCRIPT_DIR/common.sh"
1212

1313
function check_publish() {
14+
activate_plugin_tool
15+
1416
local failures=()
1517
for dir in $(pub global run flutter_plugin_tools list --plugins="$1"); do
1618
local package_name=$(basename "$dir")

script/common.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ function check_changed_packages() {
4545
fi
4646
return 0
4747
}
48+
49+
# Activates the Flutter plugin tool.
50+
# This ensures that the plugin tools dependencies are resolved using the current Dart SDK.
51+
function activate_plugin_tool() {
52+
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
53+
pub.bat global activate flutter_plugin_tools
54+
else
55+
pub global activate flutter_plugin_tools
56+
fi
57+
}

script/incremental_build.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ else
1313
PUB=pub
1414
fi
1515

16-
echo "Debugging PUB"
17-
$PUB --version
18-
which $PUB
19-
20-
$PUB global activate flutter_plugin_tools
21-
2216
# Plugins that are excluded from this task.
2317
ALL_EXCLUDED=("")
2418
# Exclude nnbd plugins from stable.
@@ -55,18 +49,18 @@ PLUGIN_SHARDING=($PLUGIN_SHARDING)
5549

5650
if [[ "${BRANCH_NAME}" == "master" ]]; then
5751
echo "Running for all packages"
58-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
52+
(cd "$REPO_DIR" && activate_plugin_tool && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
5953
else
6054
# Sets CHANGED_PACKAGES
6155
check_changed_packages
6256

6357
if [[ "$CHANGED_PACKAGES" == "" ]]; then
6458
echo "No changes detected in packages."
6559
echo "Running for all packages"
66-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
60+
(cd "$REPO_DIR" && activate_plugin_tool && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
6761
else
6862
echo running "${ACTIONS[@]}"
69-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
63+
(cd "$REPO_DIR" && activate_plugin_tool && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
7064
echo "Running version check for changed packages"
7165
# TODO(egarciad): Enable this check once in master.
7266
# (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")

0 commit comments

Comments
 (0)