mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-26 14:01:26 +00:00
Update linux build script
This commit is contained in:
parent
18e4778d48
commit
53b60ca372
1 changed files with 39 additions and 20 deletions
|
@ -1,16 +1,31 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
TARGET=debug
|
TARGET=debug
|
||||||
|
|
||||||
|
WORKDIR=$(readlink -f $(dirname $0))
|
||||||
|
|
||||||
|
NAME=$(cat $WORKDIR/app/src/main/res/values/strings.xml | grep "app_name" | cut -d">" -f2 | cut -d"<" -f1 )
|
||||||
|
VERSION=$(cat $WORKDIR/app/src/main/AndroidManifest.xml | grep "versionName" | cut -d\" -f2 | cut -d\" -f1 )
|
||||||
|
PACKAGE_NAME=$(cat $WORKDIR/app/src/main/AndroidManifest.xml | grep "package" | cut -d\" -f2 | cut -d\" -f1 )
|
||||||
|
|
||||||
|
if [ "$1" == "clean" ] || [ "$2" == "clean" ] || [ "$3" == "clean" ]; then
|
||||||
|
rm -rf $WORKDIR/../build
|
||||||
|
rm -rf $WORKDIR/build
|
||||||
|
rm -rf $WORKDIR/app/build
|
||||||
|
rm -rf $WORKDIR/app/src/main/jniLibs
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "#define Q3QVERSION \"$VERSION"\" > $WORKDIR/app/src/main/cpp/code/vr/vr_version.h
|
||||||
|
|
||||||
|
cd $WORKDIR/..
|
||||||
|
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) $TARGET
|
make -j $(getconf _NPROCESSORS_ONLN) $TARGET
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed to build ioq3"
|
echo "Failed to build ioq3"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd android
|
cd $WORKDIR
|
||||||
|
|
||||||
./make.sh
|
./make.sh
|
||||||
|
|
||||||
|
@ -19,19 +34,21 @@ if [ $? -ne 0 ]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PACKAGE_NAME=com.drbeef.ioq3quest
|
|
||||||
ANDROID_STORAGE_LOCATION=/sdcard/Android/data/$PACKAGE_NAME/files/
|
ANDROID_STORAGE_LOCATION=/sdcard/Android/data/$PACKAGE_NAME/files/
|
||||||
APK_LOCATION=./app/build/outputs/apk/debug/app-debug.apk
|
APK_LOCATION=$WORKDIR/app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|
||||||
adb install -r $APK_LOCATION
|
if [ "$1" == "install" ] || [ "$2" == "install" ] || [ "$3" == "install" ]; then
|
||||||
if [ $? -ne 0 ]; then
|
adb install -r $APK_LOCATION
|
||||||
adb uninstall $PACKAGE_NAME
|
if [ $? -ne 0 ]; then
|
||||||
adb install $APK_LOCATION
|
adb uninstall $PACKAGE_NAME
|
||||||
if [ $? -ne 0 ]; then
|
adb install $APK_LOCATION
|
||||||
echo "Failed to install apk."
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
echo "Failed to install apk."
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#adb shell mkdir -p $ANDROID_STORAGE_LOCATION
|
#adb shell mkdir -p $ANDROID_STORAGE_LOCATION
|
||||||
#adb push --sync ~/.local/share/Steam/steamapps/common/Quake\ 3\ Arena/baseq3 $ANDROID_STORAGE_LOCATION
|
#adb push --sync ~/.local/share/Steam/steamapps/common/Quake\ 3\ Arena/baseq3 $ANDROID_STORAGE_LOCATION
|
||||||
#if [ $? -ne 0 ]; then
|
#if [ $? -ne 0 ]; then
|
||||||
|
@ -49,10 +66,12 @@ fi
|
||||||
# exit 1
|
# exit 1
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
adb logcat -c
|
if [ "$1" == "start" ] || [ "$2" == "start" ] || [ "$3" == "start" ]; then
|
||||||
adb shell am start -n $PACKAGE_NAME/.MainActivity
|
adb logcat -c
|
||||||
if [ $? -ne 0 ]; then
|
adb shell am start -n $PACKAGE_NAME/.MainActivity
|
||||||
echo "Failed to start application."
|
if [ $? -ne 0 ]; then
|
||||||
exit 1
|
echo "Failed to start application."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
adb logcat *:S Quake3:V SDL:V DEBUG:V
|
||||||
fi
|
fi
|
||||||
adb logcat *:S Quake3:V SDL:V DEBUG:V
|
|
||||||
|
|
Loading…
Reference in a new issue