Skip to content

Commit 7027e9d

Browse files
Support Windows in incremental_build.sh (flutter#2989)
Allow running incremental_build.sh on Windows under Git Bash. Longer term this script should be re-written in Dart (#64025), but for now this allows running the script on Windows bots.
1 parent 854cfd5 commit 7027e9d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

script/incremental_build.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"
66

77
source "$SCRIPT_DIR/common.sh"
88

9+
if [ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]; then
10+
PUB=pub.bat
11+
else
12+
PUB=pub
13+
fi
14+
915
# Plugins that deliberately use their own analysis_options.yaml.
1016
#
1117
# This list should only be deleted from, never added to. This only exists
@@ -37,19 +43,19 @@ PLUGIN_SHARDING=($PLUGIN_SHARDING)
3743

3844
if [[ "${BRANCH_NAME}" == "master" ]]; then
3945
echo "Running for all packages"
40-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
46+
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
4147
else
4248
# Sets CHANGED_PACKAGES
4349
check_changed_packages
4450

4551
if [[ "$CHANGED_PACKAGES" == "" ]]; then
4652
echo "No changes detected in packages."
4753
echo "Running for all packages"
48-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
54+
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" ${PLUGIN_SHARDING[@]})
4955
else
5056
echo running "${ACTIONS[@]}"
51-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]})
57+
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools "${ACTIONS[@]}" --plugins="$CHANGED_PACKAGES" ${PLUGIN_SHARDING[@]})
5258
echo "Running version check for changed packages"
53-
(cd "$REPO_DIR" && pub global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")
59+
(cd "$REPO_DIR" && $PUB global run flutter_plugin_tools version-check --base_sha="$(get_branch_base_sha)")
5460
fi
5561
fi

0 commit comments

Comments
 (0)