blob: cc59db19f47c7b28ee755c4aaff3dd52e61ceef0 [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.
### `gn clean` the FUCHSIA_BUILD_DIR
## If FUCHSIA_BUILD_DIR is out/x64, this is simply:
## gn clean out/x64
## It is useful to clean the build directory without having to re-gen.
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-config-read
set -ex
"${FUCHSIA_DIR}/buildtools/gn" clean "$FUCHSIA_BUILD_DIR"
# Also clean zircon, it's not yet gn-ized, but we shouldn't care.
# "fx build-zircon -c" interprets "clean" as rm -rf $ZIRCON_BUILDROOT,
# so we do too.
rm -rf -- "$ZIRCON_BUILDROOT"