-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathovr-mobile-generate.sh
executable file
·45 lines (37 loc) · 1.16 KB
/
ovr-mobile-generate.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
# todo : verify all submodules are synced somehow
# git submodule update --init --recursive
root=$PWD
chibi_bin="./chibi-build/chibi/chibi"
# end the shell script when an error occurs
set -e
# detect operating system
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) os=linux;;
Darwin*) os=mac;;
*) os="unknown"
esac
# create "-filter <...>" command line arguments to be passed to chibi if this shell script received any arguments of its own
target_arg=""
for arg in "$@"
do
target_arg="$target_arg-target $arg "
done
if [ "$target_arg" != "" ]; then
#tput smul; # underline
tput bold; # bold
#tput setab 0; # bg = black
tput setaf 2; # fg = green
echo "using filter: $target_arg"
tput sgr0; # reset text formatting
fi
# build chibi binary
mkdir -p chibi-build/chibi
cd chibi-build/chibi && cmake -DCMAKE_BUILD_TYPE=Release ../../chibi && cmake --build . --config Release
cd "$root"
# generate cmake files using chibi
mkdir -p chibi-build/gradle-files-ovr
"$chibi_bin" -g . chibi-build/gradle-files-ovr -platform android.ovr-mobile $target_arg
if [ "$os" == "mac" ]; then
open -a Finder -R chibi-build/gradle-files-ovr/build.gradle
fi