-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 gradle files using chibi | ||
mkdir -p chibi-build/gradle-files | ||
"$chibi_bin" -g . chibi-build/gradle-files -platform android $target_arg | ||
|
||
if [ "$os" == "mac" ]; then | ||
open -a Finder -R chibi-build/gradle-files/build.gradle | ||
fi |