-
Notifications
You must be signed in to change notification settings - Fork 44
/
quick.sh
executable file
·55 lines (44 loc) · 999 Bytes
/
quick.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
set -e
fatal() {
echo "$@" 1>&2
exit 1
}
MAKE_ARGS=()
for arg in "$@"; do
case $arg in
build|run|test|list-bin|cxx-test)
ACTION="$1"
shift
break
;;
*)
MAKE_ARGS+=("${arg}")
shift
;;
esac
done
[ -n "$ACTION" ] || fatal "No action specified"
TARGET=$1
[ -n "$TARGET" ] || fatal "No target specified"
shift
make "${MAKE_ARGS[@]}" .build/current.sh glean.cabal cxx-libraries
. .build/current.sh
case $ACTION in
cxx-test)
make "${MAKE_ARGS[@]}" "cxx-test-$TARGET"
;;
*)
CABAL_ARGS=()
# Suppress "Up to date" etc. for list-bin
if [ "$ACTION" = "list-bin" ]; then
CABAL_ARGS+=(-vsilent)
fi
call_cabal "${CABAL_ARGS[@]}" "${ACTION}" -f benchmarks "${TARGET}" -- "$@"
;;
esac