| #!/bin/bash |
| |
| # Copyright 2022 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 |
| |
| # This script is used by infra to validate the package can be built. |
| |
| readonly REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/.. |
| |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/run_bazel.sh || exit $? |
| |
| help() { |
| echo |
| echo "Script used to validate the targets can be built." |
| echo |
| echo "Usage:" |
| echo " $(basename "$0") [<options>] [-- [bazel args]]" |
| echo |
| echo "Options:" |
| echo |
| echo " -o <output_base>" |
| echo " This is a bazel parameter. More about it can be found in" |
| echo " https://docs.bazel.build/versions/main/command-line-reference.html#flag--output_base" |
| echo " -a <arm64|x64>" |
| echo " architecture to build for" |
| echo |
| } |
| |
| main() { |
| local ARCHITECTURE |
| while getopts ":ho:a:b:" opt; do |
| case ${opt} in |
| 'h' | '?') |
| help |
| exit 1 |
| ;; |
| 'o') |
| OUTPUT_BASE=$OPTARG |
| ;; |
| 'a') |
| ARCHITECTURE=$OPTARG |
| esac |
| done |
| |
| if [ -z ${ARCHITECTURE+x} ]; then |
| echo "-a must be specified" |
| exit 1 |
| fi |
| |
| remainingshift=$(($OPTIND - 1)) |
| shift $remainingshift |
| |
| cd $REPO_ROOT |
| |
| python3 ../../external/fetch_sources.py |
| |
| run_bazel build --config=fuchsia_$ARCHITECTURE :vulkan-cts :vulkan-cts-split $@ |
| echo "Everything builds" |
| } |
| |
| main "$@" |