| #!/bin/bash |
| # |
| # Copyright 2022 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/helpers.sh || exit $? |
| |
| # Check if sdk-integration has changed. |
| # If it has, the SDK version has changed for the |
| # repo, and the dev will likely want to shut down |
| # things that were run using the old SDK to avoid |
| # incompatibility issues between old things and the new SDK. |
| sdk_folder="third_party/sdk-integration" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${sdk_folder}" | wc -l) -gt 0 ]] |
| then |
| echo |
| echo-warning "\e[33;1m${sdk_folder}\e[0m has changed." |
| echo-warning "This can lead to incompatiblities with emulators started using the old SDK." |
| echo-warning "We recommend running the following command to clean up resources from the old SDK:" |
| echo '$FUCHSIA_EMBEDDER_DIR/scripts/update_fuchsia_sdk.sh --no-version-bump --cleanup' |
| fi |
| |
| # Check if git hooks have changed. |
| # Prompt the dev to install the new hooks if they have. |
| hooks_folder="hooks" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- hooks | wc -l) -gt 0 ]] |
| then |
| echo |
| echo-info "\e[33;1mhooks/\e[0m has changed. To install the new Git hooks, run:" |
| echo '$FUCHSIA_EMBEDDER_DIR/scripts/install_hooks.sh' |
| fi |
| |
| # Check if the bootstrap script has changed. |
| # Prompt the dev to re-run the bootstrap script in case there's |
| # new additional setup steps they're missing. |
| bootstrap_script="scripts/bootstrap.sh" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${bootstrap_script}" | wc -l) -gt 0 ]] |
| then |
| echo |
| echo-info "\e[33;1m${bootstrap_script}\e[0m has changed." |
| echo-info "To ensure that your repository is set up correctly, you may want to re-run:" |
| echo '$FUCHSIA_EMBEDDER_DIR/scripts/bootstrap.sh' |
| fi |
| |
| # Check if the engine_revision has changed. |
| # If the dev has fetched the Flutter Engine at third_party/engine/src, |
| # warn them that their engine is now out-of-date and needs to |
| # be rebased. |
| engine_revision="src/embedder/engine/engine_revision" |
| if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${engine_revision}" | wc -l) -gt 0 && -d "${embedder_engine_dir}" ]] |
| then |
| echo |
| echo-warning "\e[33;1m${engine_revision}\e[0m has changed." |
| echo-warning "Your repo's checkout of Flutter Engine at ${embedder_engine_dir} is now out-of-date." |
| echo-warning "To keep your --with-engine builds working, you should sync the Flutter Engine by running:" |
| echo '$FUCHSIA_EMBEDDER_DIR/scripts/sync_engine_to_revision.sh $(cat $FUCHSIA_EMBEDDER_DIR/third_party/dart-pkg/internal/flutter/flutter/bin/internal/engine.version)' |
| fi |