Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove check_changed_packages
  • Loading branch information
stuartmorgan-g committed May 7, 2021
commit 4a956907e6a72da990dc83e45738c0796023ddd4
14 changes: 2 additions & 12 deletions script/build_all_plugins_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ readonly REPO_DIR="$(dirname "$SCRIPT_DIR")"

source "$SCRIPT_DIR/common.sh"

check_changed_packages > /dev/null

# This list should be kept as short as possible, and things should remain here
# only as long as necessary, since in general the goal is for all of the latest
# versions of plugins to be mutually compatible.
Expand Down Expand Up @@ -63,18 +61,10 @@ for version in "${BUILD_MODES[@]}"; do

if [ $? -eq 0 ]; then
echo "Successfully built $version all_plugins app."
echo "All first party plugins compile together."
echo "All first-party plugins compile together."
else
error "Failed to build $version all_plugins app."
if [[ "${#CHANGED_PACKAGE_LIST[@]}" == 0 ]]; then
error "There was a failure to compile all first party plugins together, but there were no changes detected in packages."
else
error "Changes to the following packages may prevent all first party plugins from compiling together:"
for package in "${CHANGED_PACKAGE_LIST[@]}"; do
error "$package"
done
echo ""
fi
error "This indicates a conflict between two or more first-party plugins."
failures=$(($failures + 1))
fi
done
Expand Down
42 changes: 0 additions & 42 deletions script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,6 @@ function error() {
echo "$@" 1>&2
}

function get_branch_base_sha() {
local branch_base_sha="$(git merge-base --fork-point FETCH_HEAD HEAD || git merge-base FETCH_HEAD HEAD)"
echo "$branch_base_sha"
}

function check_changed_packages() {
# Try get a merge base for the branch and calculate affected packages.
# We need this check because some CIs can do a single branch clones with a limited history of commits.
local packages
local branch_base_sha="$(get_branch_base_sha)"
if [[ "$branch_base_sha" != "" ]]; then
echo "Checking for changed packages from $branch_base_sha"
IFS=$'\n' packages=( $(git diff --name-only "$branch_base_sha" HEAD | grep -o "packages/[^/]*" | sed -e "s/packages\///g" | sort | uniq) )
else
error "Cannot find a merge base for the current branch to run an incremental build..."
error "Please rebase your branch onto the latest master!"
return 1
fi

CHANGED_PACKAGES=""
CHANGED_PACKAGE_LIST=()

# Filter out packages that have been deleted.
for package in "${packages[@]}"; do
if [ -d "$REPO_DIR/packages/$package" ]; then
CHANGED_PACKAGES="${CHANGED_PACKAGES},$package"
CHANGED_PACKAGE_LIST=("${CHANGED_PACKAGE_LIST[@]}" "$package")
fi
done

if [[ "${#CHANGED_PACKAGE_LIST[@]}" == 0 ]]; then
echo "No changes detected in packages."
else
echo "Detected changes in the following ${#CHANGED_PACKAGE_LIST[@]} package(s):"
for package in "${CHANGED_PACKAGE_LIST[@]}"; do
echo "$package"
done
echo ""
fi
return 0
}

# Runs the plugin tools from the plugin_tools git submodule.
function plugin_tools() {
(pushd "$REPO_DIR/script/tool" && dart pub get && popd) >/dev/null
Expand Down