blob: 1d3c6c7baccb182213563e3d3142583a7bd9bc7c [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=Software delivery
#### DEPRECATED
### build Fuchsia and push to device
## usage: fx build-push [ninja option,...] [target,...]
##
## Deprecated: This command is deprecated as it is misleading. Packages in
## Fuchsia are only cached, not installed, and the cache is updated on-demand
## when a component is launched from a fuchsia package URL. An attempt to "push"
## a package as implemented here only performs one of these resolutions, and may
## or may not influence what happens "next" if a user "runs" a component url. As
## such this command influences a poor mental model of the system and should be
## avoided.
##
## Build ALL targets. After building all the targets, push the ones that were
## supplied to this command. If no targets were specified push all of them.
## The packages are pushed to the device specified. If no device is supplied
## explicitly this will push to the single connected device. If multiple devices
## are connected and no device is specified, pushing will fail.
set -e
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/updates.sh || exit $?
fx-config-read
fx-warn "build-push is deprecated"
fx-warn "The concept of 'pushing' packages to the target is misleading"
fx-warn "Users are best to move to one of:"
fx-warn " fx test"
fx-warn " fx run"
function main {
local args=()
local targets=()
while (($#)); do
case "$1" in
-C|-f|-j|-k|-l|-t|-w)
args+=("$1")
shift
args+=("$1")
;;
-n|-v)
args+=("$1")
;;
*)
targets+=("$1")
esac
shift
done
fx-command-run build "${args[@]}"
check-for-package-server || return 1
fx-command-run push-package "${targets[@]}"
}
main "$@"