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

Commit

Permalink
Run pub global activate before pub global run
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Feb 2, 2021
1 parent 9271fdd commit e5c80d7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
5 changes: 0 additions & 5 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ task:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
matrix:
- name: publishable
script:
Expand Down Expand Up @@ -122,7 +121,6 @@ task:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
matrix:
- name: build-linux+drive-examples
install_script:
Expand All @@ -147,7 +145,6 @@ task:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-11 com.apple.CoreSimulator.SimRuntime.iOS-14-3 | xargs xcrun simctl boot
Expand Down Expand Up @@ -201,7 +198,6 @@ task:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
create_simulator_script:
- xcrun simctl list
- xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-X com.apple.CoreSimulator.SimRuntime.iOS-13-3 | xargs xcrun simctl boot
Expand Down Expand Up @@ -231,7 +227,6 @@ task:
- flutter channel master
- flutter upgrade
- git fetch origin master
activate_script: pub global activate flutter_plugin_tools
matrix:
- name: build_all_plugins_app
script:
Expand Down
2 changes: 1 addition & 1 deletion script/build_all_plugins_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fi

echo "Excluding the following plugins: $ALL_EXCLUDED"

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

function error() {
echo "$@" 1>&2
Expand Down
2 changes: 2 additions & 0 deletions script/check_publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"
source "$SCRIPT_DIR/common.sh"

function check_publish() {
activate_plugin_tool

local failures=()
for dir in $(pub global run flutter_plugin_tools list --plugins="$1"); do
local package_name=$(basename "$dir")
Expand Down
10 changes: 10 additions & 0 deletions script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,13 @@ function check_changed_packages() {
fi
return 0
}

# Activate the plugin.
# This ensures that the plugin tools dependencies are resolved using the current Dart SDK.
function activate_plugin_tool() {
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
pub.bat global activate flutter_plugin_tools
else
pub global activate flutter_plugin_tools
fi
}
12 changes: 3 additions & 9 deletions script/incremental_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ else
PUB=pub
fi

echo "Debugging PUB"
$PUB --version
which $PUB

$PUB global activate flutter_plugin_tools

# Plugins that are excluded from this task.
ALL_EXCLUDED=("")
# Exclude nnbd plugins from stable.
Expand Down Expand Up @@ -55,18 +49,18 @@ PLUGIN_SHARDING=($PLUGIN_SHARDING)

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

if [[ "$CHANGED_PACKAGES" == "" ]]; then
echo "No changes detected in packages."
echo "Running for all packages"
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
(cd "$REPO_DIR" && activate_plugin_tool && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
else
echo running "${ACTIONS[@]}"
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
(cd "$REPO_DIR" && activate_plugin_tool && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" --exclude="$ALL_EXCLUDED" ${PLUGIN_SHARDING[@]})
echo "Running version check for changed packages"
# TODO(egarciad): Enable this check once in master.
# (cd "$REPO_DIR" && $PUB global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")
Expand Down

0 comments on commit e5c80d7

Please sign in to comment.