[godot] More CI script refactoring.

This commit is contained in:
Mario Zechner 2022-06-29 09:37:57 +02:00
parent 72cb43458a
commit a6f4bc0e8a
3 changed files with 52 additions and 31 deletions

View File

@ -4,15 +4,29 @@ set -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null pushd $dir > /dev/null
if [ "$#" -eq 0 ] && [ ! -d ../godot ]; then if [ ! "$#" -eq 1 ]; then
echo "No Godot clone found. Run ./build.sh <Godot branch or tag> <dev> first." echo "Usage: ./build-templates.sh <platform>"
echo
echo "e.g.:"
echo " ./build-templates.sh windows"
echo " ./build-templates.sh linux"
echo " ./build-templates.sh macos"
echo " ./build-templates.sh ios"
echo " ./build-templates.sh android"
echo " ./build-templates.sh web"
echo
exit 1 exit 1
fi fi
version="3.4.5.rc" if [ ! -d ../godot ]; then
echo "No Godot clone found. Run ./setup.sh <Godot branch or tag> <dev> first."
exit 1
fi
platform=${1%/}
pushd ../godot pushd ../godot
if [ `uname` == "Darwin" ]; then if [ "$platform" = "macos" ]; then
# --- macOS --- # --- macOS ---
# generates osx.zip # generates osx.zip
@ -30,11 +44,10 @@ if [ `uname` == "Darwin" ]; then
cp godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64 cp godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64
cp godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64 cp godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64
chmod +x osx_template.app/Contents/MacOS/godot_osx* chmod +x osx_template.app/Contents/MacOS/godot_osx*
echo "$version" > version.txt
rm -rf osx.zip rm -rf osx.zip
zip -q -9 -r osx.zip osx_template.app version.txt zip -q -9 -r osx.zip osx_template.app
popd popd
elif [ "$platform" = "ios" ]; then
# --- iOS -- # --- iOS --
# generates iphone.zip # generates iphone.zip
@ -55,11 +68,13 @@ if [ `uname` == "Darwin" ]; then
cp libgodot.iphone.opt.simulator.a ios_xcode/libgodot.iphone.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a cp libgodot.iphone.opt.simulator.a ios_xcode/libgodot.iphone.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
cp libgodot.iphone.opt.debug.arm64.a ios_xcode/libgodot.iphone.debug.xcframework/ios-arm64/libgodot.a cp libgodot.iphone.opt.debug.arm64.a ios_xcode/libgodot.iphone.debug.xcframework/ios-arm64/libgodot.a
cp libgodot.iphone.opt.debug.simulator.a ios_xcode/libgodot.iphone.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a cp libgodot.iphone.opt.debug.simulator.a ios_xcode/libgodot.iphone.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
echo "$version" > version.txt
rm -rf iphone.zip rm -rf iphone.zip
pushd ios_xcode pushd ios_xcode
zip -q -9 -r ../iphone.zip * zip -q -9 -r ../iphone.zip *
popd popd
popd popd
else
echo "Unknown platform: $platform"
exit 1
fi fi
popd popd

View File

@ -4,19 +4,13 @@ set -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null pushd $dir > /dev/null
if [ ! "$#" -eq 0 ] && [ ! "$#" -eq 2 ]; then if [ ! "$#" -eq 1 ]; then
echo "Usage: ./build.sh <target>" echo "Usage: ./build.sh <target>"
echo echo
echo "e.g.:" echo "e.g.:"
echo " ./build.sh release_debug" echo " ./build.sh release_debug"
echo " ./build.sh debug" echo " ./build.sh debug"
echo echo
read version
exit 1
fi
if [ "$#" -eq 0 ]; then
echo "Please specify a target, either 'debug' or 'release_debug'"
exit 1 exit 1
fi fi
@ -25,21 +19,34 @@ if [ ! -d ../godot ]; then
exit 1 exit 1
fi fi
branch=${1%/} target="target=${1%/}"
dev="false"
if [ "${2}" = "true" ]; then if [ -f "../godot/custom.py" ]; then
target="target=debug" dev="true"
else
target=""
fi fi
pushd ../godot pushd ../godot
scons $target arch=x86_64 compiledb=yes custom_modules="../spine_godot" -j16 if [ `uname` == 'Darwin' ] && [ $dev = "false" ]; then
if [ `uname` == 'Darwin' ]; then scons $target arch=x86_64 compiledb=yes custom_modules="../spine_godot" -j16
scons $target arch=arm64 compiledb=yes custom_modules="../spine_godot" -j16 scons $target arch=arm64 compiledb=yes custom_modules="../spine_godot" -j16
lipo -create bin/godot.osx.tools.x86_64 bin/godot.osx.tools.arm64 -output bin/godot.osx.tools.universal
strip -S -x bin/godot.osx.tools.universal pushd bin
cp -r ../misc/dist/osx_tools.app .
mv osx_tools.app Godot.app
mkdir -p Godot.app/Contents/MacOS
if [ "$target" = "debug" ]; then
lipo -create godot.osx.tools.x86_64 godot.osx.tools.arm64 -output godot.osx.tools.universal
strip -S -x godot.osx.tools.universal
cp godot.osx.tools.universal Godot.app/Contents/MacOS/Godot
else
lipo -create godot.osx.opt.tools.x86_64 godot.osx.opt.tools.arm64 -output godot.osx.tools.universal
strip -S -x godot.osx.opt.tools.universal
cp godot.osx.opt.tools.universal Godot.app/Contents/MacOS/Godot
fi
chmod +x Godot.app/Contents/MacOS/Godot
popd
else
scons $target compiledb=yes custom_modules="../spine_godot" -j16
fi fi
popd popd

3
spine-godot/build/setup.sh Normal file → Executable file
View File

@ -4,14 +4,13 @@ set -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null pushd $dir > /dev/null
if [ ! "$#" -eq 0 ] && [ ! "$#" -eq 2 ]; then if [ ! "$#" -eq 2 ]; then
echo "Usage: ./setup.sh <Godot branch or tag> <dev:true|false>" echo "Usage: ./setup.sh <Godot branch or tag> <dev:true|false>"
echo echo
echo "e.g.:" echo "e.g.:"
echo " ./setup.sh 3.4.4-stable true" echo " ./setup.sh 3.4.4-stable true"
echo " ./setup.sh master false" echo " ./setup.sh master false"
echo echo
read version
exit 1 exit 1
fi fi