| #!/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=Other | |
| ### entry point to start/stop the Fuchsia emulator via fuchsia virtual device launcher | |
| set -e | |
| DEVSHELL_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | |
| source "${DEVSHELL_DIR}"/lib/image_build_vars.sh || exit $? | |
| 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 "$@" |