blob: a5cf7a85507082c9de699c5ba0d40d9eb594523c [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=Build
### run `gn gen` against the Fuchsia build directories.
## Execute a `gn gen` against the Fuchsia build
## If successful, execute a `gn gen` against the Fuchsia build.
##
## In abstract, if FUCHSIA_BUILD_DIR is out/x64, this is simply:
## gn gen out/x64
## It is useful if one has by some mechanism deleted the ninja artifacts, but
## not the args.gn, e.g. if one CTRL+C's a regen step (gn bug).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
if ! fx-build-dir-if-present; then
fx-error "No build directory found."
fx-error "Run \"fx set\" to create a new build directory, or specify one with --dir"
exit 1
fi
fx-gen "$@"