blob: 09639b511baa12e60ee2f1720d99abfe7e59aa50 [file] [log] [blame]
#!/bin/bash
# Copyright 2018 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
### compute some blobfs statistics from the build
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/vars.sh || exit $?
fx-config-read
case "$(uname -s)" in
Linux)
PREBUILT_DART="${FUCHSIA_DIR}/prebuilt/third_party/dart/linux-x64/bin/dart"
;;
Darwin)
PREBUILT_DART="${FUCHSIA_DIR}/prebuilt/third_party/dart/mac-x64/bin/dart"
;;
esac
# Merge our package config with the one in third_party/dart-pkg/pub
fx-command-run merge-package-config \
--first "$FUCHSIA_DIR/third_party/dart-pkg/pub/package_config.json" \
--second "${FUCHSIA_DIR}/tools/blobstats/package_config.json" \
--out "${FUCHSIA_BUILD_DIR}/fx_blobstats.package_config.json"
cd "${FUCHSIA_BUILD_DIR}"
exec "${PREBUILT_DART}" \
--packages="${FUCHSIA_BUILD_DIR}/fx_blobstats.package_config.json" \
--enable-experiment=non-nullable \
--no-sound-null-safety \
"${FUCHSIA_DIR}/tools/blobstats/bin/main.dart" "$@"