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

Commit 9c6b210

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

File tree

5 files changed

+21
-22
lines changed

5 files changed

+21
-22
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" && plugin_tools all-plugins-app --exclude $ALL_EXCLUDED)
6868

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

script/check_publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source "$SCRIPT_DIR/common.sh"
1212

1313
function check_publish() {
1414
local failures=()
15-
for dir in $(pub global run flutter_plugin_tools list --plugins="$1"); do
15+
for dir in $(plugin_tools list --plugins="$1"); do
1616
local package_name=$(basename "$dir")
1717

1818
echo "Checking that $package_name can be published."

script/common.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,19 @@ function check_changed_packages() {
4545
fi
4646
return 0
4747
}
48+
49+
# Normalizes the call to the pub command.
50+
function pub_command() {
51+
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
52+
pub.bat "$@"
53+
else
54+
pub "$@"
55+
fi
56+
}
57+
58+
# Activates the Flutter plugin tool to ensures that the plugin tools dependencies
59+
# are resolved using the current Dart SDK.
60+
# Finally, runs the tool with the parameters.
61+
function plugins_tools() {
62+
pub_command global activate flutter_plugin_tools && pub_command global run flutter_plugin_tools "$@"
63+
}

script/incremental_build.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,6 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"
77
source "$SCRIPT_DIR/common.sh"
88
source "$SCRIPT_DIR/nnbd_plugins.sh"
99

10-
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
11-
PUB=pub.bat
12-
else
13-
PUB=pub
14-
fi
15-
16-
echo "Debugging PUB"
17-
$PUB --version
18-
which $PUB
19-
20-
$PUB global activate flutter_plugin_tools
21-
2210
# Plugins that are excluded from this task.
2311
ALL_EXCLUDED=("")
2412
# Exclude nnbd plugins from stable.
@@ -55,18 +43,18 @@ PLUGIN_SHARDING=($PLUGIN_SHARDING)
5543

5644
if [[ "${BRANCH_NAME}" == "master" ]]; then
5745
echo "Running for all packages"
58-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
46+
(cd "$REPO_DIR" && plugins_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
5947
else
6048
# Sets CHANGED_PACKAGES
6149
check_changed_packages
6250

6351
if [[ "$CHANGED_PACKAGES" == "" ]]; then
6452
echo "No changes detected in packages."
6553
echo "Running for all packages"
66-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
54+
(cd "$REPO_DIR" && plugins_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
6755
else
6856
echo running "${ACTIONS[@]}"
69-
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
57+
(cd "$REPO_DIR" && plugins_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
7058
echo "Running version check for changed packages"
7159
# TODO(egarciad): Enable this check once in master.
7260
# (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")

0 commit comments

Comments
 (0)