Skip to content

Commit 0d19d7b

Browse files
committed
feat: update server source code
1 parent 7b653d7 commit 0d19d7b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

server/scripts/build-wrapper.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
# Wrapper script to invoke gradle from meson
3+
set -e
4+
5+
# Do not execute gradle when ninja is called as root (it would download the
6+
# whole gradle world in /root/.gradle).
7+
# This is typically useful for calling "sudo ninja install" after a "ninja
8+
# install"
9+
if [[ "$EUID" == 0 ]]
10+
then
11+
echo "(not invoking gradle, since we are root)" >&2
12+
exit 0
13+
fi
14+
15+
PROJECT_ROOT="$1"
16+
OUTPUT="$2"
17+
BUILDTYPE="$3"
18+
19+
# gradlew is in the parent of the server directory
20+
GRADLE=${GRADLE:-$PROJECT_ROOT/../gradlew}
21+
22+
if [[ "$BUILDTYPE" == debug ]]
23+
then
24+
"$GRADLE" -p "$PROJECT_ROOT" assembleDebug
25+
cp "$PROJECT_ROOT/build/outputs/apk/debug/server-debug.apk" "$OUTPUT"
26+
else
27+
"$GRADLE" -p "$PROJECT_ROOT" assembleRelease
28+
cp "$PROJECT_ROOT/build/outputs/apk/release/server-release-unsigned.apk" "$OUTPUT"
29+
fi

0 commit comments

Comments
 (0)