| #!/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. |
| |
| set -e |
| |
| DEVSHELL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" |
| source "${DEVSHELL_DIR}"/lib/image_build_vars.sh || exit $? |
| |
| export HOST_OUT_DIR |
| export PREBUILT_AEMU_DIR |
| export PREBUILT_VDL_DIR |
| export PREBUILT_GRPCWEBPROXY_DIR |
| export IMAGE_FVM_RAW |
| export IMAGE_QEMU_KERNEL_RAW |
| export IMAGE_ZIRCONA_ZBI |
| export FUCHSIA_BUILD_DIR |
| export FUCHSIA_ZBI_COMPRESSION |
| |
| function main { |
| local build=false |
| if is_feature_enabled "incremental"; then |
| # In incremental workflows, build/refresh images is enabled by default |
| build=true |
| fi |
| args=() |
| while (( $# )); do |
| case "$1" in |
| --no-build) |
| build=false |
| ;; |
| --build) |
| build=true |
| ;; |
| --help|kill) |
| # these options don't require building images |
| build=false |
| args+=( "$1" ) |
| ;; |
| *) |
| args+=( "$1" ) |
| esac |
| shift |
| done |
| |
| if $build; then |
| fx-info "Building/refreshing target 'images'" |
| fx-command-run build images |
| fi |
| fx-command-exec host-tool fvdl "${args[@]}" |
| } |
| |
| main "$@" |