| #!/bin/bash |
| # Copyright 2020 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. |
| |
| #### CATEGORY=Run, inspect and debug |
| ### Code size attribution on binaries from the system image |
| |
| set -eo pipefail |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/vars.sh || exit $? |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/dart_utils.sh || exit $? |
| fx-config-read |
| |
| if [[ ${FUCHSIA_ARCH} != "arm64" ]]; then |
| echo "\`fx codesize\` is only supported in arm64 builds. The current" \ |
| "architecture is ${FUCHSIA_ARCH}. Please switch to the correct" \ |
| "product using \`fx set\`." |
| exit 1 |
| fi |
| |
| STATUS=$(fx-command-run status) |
| run-dart-tool codesize --status "$STATUS" "$@" |