-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-all.sh
executable file
·47 lines (39 loc) · 1.57 KB
/
build-all.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
#!/bin/env bash
if [ -z "$RUSTUP_TOOLCHAIN" ]; then
export RUSTUP_TOOLCHAIN="stable" # "stable" or "nightly"
fi
if [ -z "$RUSTUP_PROFILE" ]; then
export RUSTUP_PROFILE="debug" # "debug" or "release"
fi
# Build Time Autovars
SCRIPT=`realpath "$0"`
SCRIPT_DIR=`dirname "$SCRIPT"`
PROJECT_ROOT=$SCRIPT_DIR
# Build Vars
SOURCE_DATE_EPOCH="`git --no-pager log -1 --format="%ct"`"
PATH="$PROJECT_ROOT/.tools:$PATH"
PATH="$PROJECT_ROOT/.tools/butler:$PATH"
echo "Building x86_64-unknown-linux-gnu as AppImage..."
cargo +$RUSTUP_TOOLCHAIN appimage --features appimage --target=x86_64-unknown-linux-gnu --bin catgirl-engine
echo "Building x86_64-unknown-linux-musl Server Only..."
if [ $RUSTUP_PROFILE == "release" ]; then
cargo +$RUSTUP_TOOLCHAIN build --target=x86_64-unknown-linux-musl --release --bin catgirl-engine --no-default-features --features server,logging-subscriber
else
cargo +$RUSTUP_TOOLCHAIN build --target=x86_64-unknown-linux-musl --bin catgirl-engine --no-default-features --features server,logging-subscriber
fi
echo "Building x86_64-pc-windows-gnu..."
if [ $RUSTUP_PROFILE == "release" ]; then
cargo build --target=x86_64-pc-windows-gnu --release --bin catgirl-engine
else
cargo build --target=x86_64-pc-windows-gnu --bin catgirl-engine
fi
echo "Building wasm32-unknown-unknown..."
$PROJECT_ROOT/examples/wasm/web/build.sh
echo "Building Android..."
cd $PROJECT_ROOT/android
touch $PROJECT_ROOT/android/local.properties
if [ $RUSTUP_PROFILE == "release" ]; then
$PROJECT_ROOT/android/gradlew assembleRelease
else
$PROJECT_ROOT/android/gradlew assemble
fi