forked from algolia/algoliasearch-client-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselect-flavor.sh
executable file
·37 lines (32 loc) · 1.03 KB
/
select-flavor.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
#!/usr/bin/env bash
# ============================================================================ #
# SELECT FLAVOR #
# ============================================================================ #
# SUMMARY
# -------
# This script is used to select the flavor (online or offline) that will be
# compiled. For an explanation why this is necessary, see `doc/build.md`.
# ============================================================================ #
# Reflection.
SELF_ROOT=`cd \`dirname "$0"\`; pwd`
SELF_NAME=`basename "$0"`
# Print usage information to stdout.
usage()
{
echo "Usage:"
echo " $SELF_NAME <online|offline>"
}
# Check command-line arguments.
if [ $# -lt 1 ]; then
echo "Please specify a flavor!" 1>&2
usage 1>&2
exit 1
fi
FLAVOR="$1"
if [[ $FLAVOR != "online" && $FLAVOR != "offline" ]]; then
echo "Unknown flavor '$FLAVOR'" 1>&2
usage 1>&2
exit 1
fi
# Do it!
ln -sf "build-$FLAVOR.gradle" "$SELF_ROOT/algoliasearch/build.gradle"