#! /bin/sh RED="\033[0;31m" RESET="\033[0m" DST=$HOME/bin DST_EXPORT=$DST/godot-export FORCE=0 CLEAN=0 ANDROID=0 for I in $@ do case $I in f) FORCE=1 ;; a) ANDROID=1 ;; c) CLEAN=1 ;; esac done function build() { J=$((`nproc`)) export CXX=/usr/lib/ccache/bin/clang++ export CC=/usr/lib/ccache/bin/clang rm ./bin/* platform=linuxbsd platform=x11 [ $CLEAN -eq 1 ] && scons platform=$platform --clean # https://docs.godotengine.org/en/3.2/development/compiling/compiling_for_x11.html target=release_debug echo -e "build : ${RED}$platform$RESET target=$RED$target$RESET" time scons -j$J platform=$platform target=$target tools=yes colored=yes pulseaudio=no bits=64 warnings=no # scons -j$J platform=$platform target=$target tools=no colored=yes pulseaudio=no bits=64 warnings=no # scons -j$J platform=$platform target=$target tools=no colored=yes pulseaudio=no bits=32 warnings=no cp ./bin/godot*tools* $DST/godot if [ $ANDROID -eq 1 ] then export ANDROID_HOME=/opt/android-sdk export ANDROID_NDK_ROOT=/opt/android-ndk [ ! -d $DST_EXPORT ] && mkdir $DST_EXPORT [ $CLEAN -eq 1 ] && scons platform=android --clean # https://docs.godotengine.org/en/3.2/development/compiling/compiling_for_android.html echo -e "${RED}gradlew clean$RESET" pushd platform/android/java && ./gradlew cleanGodotTemplates && popd ndk_platform=android-29 for target in release debug; do for arch in arm64v8 armv7; #x86_6 do echo -e "build : ${RED}android$RESET android_arch=$RED$arch$RESET target=$RED$target$RESET ndk_platform=$RED$ndk_platform$RESET" time scons -j$J platform=android target=$target android_arch=$arch ndk_platform=$ndk_platform tools=no disable_3d=true done done echo -e "${RED}gradlew build$RESET" pushd platform/android/java && ./gradlew generateGodotTemplates && popd fi } pushd ./godot if [ $CLEAN -eq 1 ] then find -name \*.o -delete find -name \*.gen.h -delete find -name \*.gen.cpp -delete fi HEAD_PREV=$(git log HEAD~1.. --pretty=format:'%H' | head -n1) echo -e "current HEAD : $RED$HEAD_PREV$RESET" git pull HEAD_NOW=$(git log HEAD~1.. --pretty=format:'%H' | head -n1) echo -e "updated HEAD : $RED$HEAD_NOW$RESET" if [ $FORCE = 1 -o "$HEAD_PREV" != "$HEAD_NOW" ] then build git log $HEAD_PREV.. fi popd ls -l godot/bin/ # scons -j4 platform=linuxbsd target=release_debug tools=yes colored=yes pulseaudio=no bits=64 warnings=no