| #!/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. |
| # |
| # Bumps the version of all dependencies of this repo to the latest version. |
| # Because some of them use the Fuchsia SDK, they must be kept in lockstep to |
| # prevent Fuchsia SDK incompatiblities. |
| # |
| # Usage: |
| # update_dependencies.sh |
| # |
| # Arguments: |
| # --cleanup: Removes old product bundles and shuts down old emulators. |
| # Default: false |
| # --goma: Acclerates the Flutter Engine build using GOMA. |
| # For Googlers only, sorry. :( |
| |
| set -e # Fail on any error. |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/helpers.sh || exit $? |
| |
| ensure-embedder-dir |
| |
| # Parse arguments. |
| cleanup_args= |
| goma_args= |
| while [[ $# -gt 0 ]]; do |
| case $1 in |
| --cleanup) |
| cleanup_args="--cleanup" |
| shift # past argument |
| ;; |
| --goma) |
| goma_args="--goma" |
| shift # past argument |
| ;; |
| *) |
| shift # past value |
| ;; |
| esac |
| done |
| |
| # First bump Flutter. |
| git -C "${FUCHSIA_EMBEDDER_DIR}"/third_party/dart-pkg/internal/flutter/flutter pull origin main |
| |
| # Then bump Flutter Engine to match Flutter. |
| "${FUCHSIA_EMBEDDER_DIR}"/scripts/sync_engine_to_revision.sh "$(cat ${FUCHSIA_EMBEDDER_DIR}/third_party/dart-pkg/internal/flutter/flutter/bin/internal/engine.version)" |
| "${FUCHSIA_EMBEDDER_DIR}"/scripts/build_and_copy_engine_artifacts.sh ${goma_args} --cpu x64 |
| "${FUCHSIA_EMBEDDER_DIR}"/scripts/build_and_copy_engine_artifacts.sh ${goma_args} --cpu arm64 |
| |
| # Bump the Embedder's Fuchsia SDK to whatever is the latest version and pray that the |
| # Engine's Fuchsia SDK is close enough to prevent incompatibility issues. |
| # TODO(akbiggs): Keep the Fuchsia SDK version in sync between the Emebedder repo and |
| # Engine repo. |
| "${FUCHSIA_EMBEDDER_DIR}"/scripts/update_fuchsia_sdk.sh ${cleanup_args} |
| |