2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-11 11:30:08 +01:00
xash3d-fwgs/compile.sh

62 lines
1.4 KiB
Bash
Raw Normal View History

#!/bin/sh
ARCHS="armeabi-v7a armeabi x86"
TOOLCHAIN=4.9
2019-05-12 01:59:59 +02:00
API=9
ROOT="$PWD" # compile.sh must be run from root of android project sources
SUBDIRS="xash3d-fwgs hlsdk-xash3d"
SYMLINKS_APPEND=""
2019-05-06 18:12:39 +02:00
if [ $# -ne 2 ]; then
BUILD_TYPE=debug
else
BUILD_TYPE=$1
fi
# Cleanup libraries
rm -rf android/lib/
2019-07-29 07:39:40 +02:00
# Generate extras.pak(TODO: move this to waf somehow)
if [ -L "xash3d-fwgs-sl" ]; then
python xash3d-fwgs-sl/scripts/makepak.py xash-extras android/assets/extras.pak
else
python xash3d-fwgs/scripts/makepak.py xash-extras android/assets/extras.pak
fi
# Generate configs
android/gen-config.sh android/
android/gen-version.sh android/
2019-05-06 18:12:39 +02:00
# configure android project
2019-05-10 02:13:57 +02:00
./waf configure -T $BUILD_TYPE || exit 1
2019-05-06 18:12:39 +02:00
build_native_project()
{
mkdir -p $ROOT/build-$1/$2
if [ -L "$1-sl" ]; then
cd $1-sl # need to change directory, as waf doesn't work well with symlinks(used in development purposes)
else
cd $1
fi
2019-05-06 18:12:39 +02:00
./waf -o $ROOT/build-$1/$2 configure -T $BUILD_TYPE --android="$2,$3,$4" build || exit 1
./waf install --destdir=$ROOT/build/android/
cd $ROOT # obviously, we can't ../ from symlink directory, so change to our root directory
}
# Do it inside waf?
for i in $ARCHS; do
for j in $SUBDIRS; do
build_native_project "$j" "$i" "$TOOLCHAIN" "$API"
done
done
# Run waf
2019-05-10 02:13:57 +02:00
./waf build || exit 1
2019-05-06 18:12:39 +02:00
# sign
cp build/android/xashdroid-src.apk xashdroid.apk
# :)
if [ $USER = "a1ba" ]; then
apksigner sign --ks ../myks.keystore xashdroid.apk
fi