forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Incremental Build Script (flutter#422)
Similar to `plugin_tools.sh` but doesn't depend on Travis or any other CI. +use it for Cirrus CI
- Loading branch information
Showing
2 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -ev | ||
|
||
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [ "${BRANCH_NAME}" = "master" ]; then | ||
echo "Running for all packages" | ||
pub global run flutter_plugin_tools "$@" | ||
else | ||
# Make sure there is up-to-date master. | ||
git fetch origin master | ||
BRANCH_BASE_SHA=$(git merge-base --fork-point FETCH_HEAD HEAD) | ||
echo "Checking changes from $BRANCH_BASE_SHA..." | ||
FLUTTER_CHANGED_GLOBAL=`git diff --name-only $BRANCH_BASE_SHA HEAD | grep -v packages | wc -l` | ||
FLUTTER_CHANGED_PACKAGES=`git diff --name-only $BRANCH_BASE_SHA HEAD | grep -o "packages/[^/]*" | sed -e "s/packages\///g" | sort | uniq | paste -s -d, -` | ||
if [ "${FLUTTER_CHANGED_PACKAGES}" = "" ] || [ $FLUTTER_CHANGED_GLOBAL -gt 0 ]; then | ||
echo "Running for all packages" | ||
pub global run flutter_plugin_tools "$@" | ||
else | ||
echo "Running only for $FLUTTER_CHANGED_PACKAGES" | ||
pub global run flutter_plugin_tools "$@" --plugins=$FLUTTER_CHANGED_PACKAGES | ||
fi | ||
fi |