[godot] Rework build scripts for CI

This commit is contained in:
Mario Zechner 2022-06-27 12:33:05 +02:00
parent 63a8f65e35
commit f2c7ab3683
10 changed files with 76 additions and 28 deletions

1
.gitignore vendored
View File

@ -175,4 +175,5 @@ spine-godot/example/.godot
spine-godot/example-v4/.godot
spine-cocos2dx/example/build-macos
spine-godot/logs
!spine-godot/build
spine-ts/spine-ts.zip

View File

@ -1,5 +0,0 @@
#/bin/sh
set -e
pushd godot
scons compiledb=yes custom_modules="../spine_godot" -j16
popd

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null
if [ "$#" -eq 0 ] && [ ! -d ../godot ]; then
echo "No Godot clone found. Run ./build.sh <Godot branch or tag> <dev> first."
exit 1
fi
pushd ../godot
if [ `uname` == "Darwin" ]; then
scons platform=osx tools=no target=release arch=x86_64 custom_modules="../spine_godot" --jobs=$(sysctl -n hw.logicalcpu)
scons platform=osx tools=no target=release_debug arch=x86_64 custom_modules="../spine_godot" --jobs=$(sysctl -n hw.logicalcpu)
scons platform=osx tools=no target=release arch=arm64 custom_modules="../spine_godot" --jobs=$(sysctl -n hw.logicalcpu)
scons platform=osx tools=no target=release_debug arch=arm64 custom_modules="../spine_godot" --jobs=$(sysctl -n hw.logicalcpu)
fi
popd

56
spine-godot/build/build.sh Executable file
View File

@ -0,0 +1,56 @@
#!/bin/bash
set -e
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
pushd $dir > /dev/null
if [ ! "$#" -eq 0 ] && [ ! "$#" -eq 2 ]; then
echo "Usage: ./build.sh <Godot branch or tag> <dev>"
echo
echo "e.g.:"
echo " ./build.sh 3.4.4-stable true"
echo " ./build.sh master master"
echo
echo "If no arguments are given"
read version
exit 1
fi
if [ "$#" -eq 0 ] && [ ! -d ../godot ]; then
echo "No Godot clone found. Run ./build.sh <Godot branch or tag> <dev> first."
exit 1
fi
branch=${1%/}
if [ "${2}" = "true" ]; then
target="target=debug"
else
target=""
fi
pushd ..
echo `pwd`
if [ ! -z "$branch" ]; then
rm -rf godot
git clone --depth 1 https://github.com/godotengine/godot.git -b $branch
if [ "${2}" = "true" ]; then
cp -r .idea godot
cp build/custom.py godot
rm -rf example/.import
rm -rf example/.godot
fi
fi
cp -r ../spine-cpp/spine-cpp spine_godot
popd
pushd ../godot
scons $target arch=x86_64 compiledb=yes custom_modules="../spine_godot" -j16
if [ `uname` == 'Darwin' ]; then
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
fi
popd
popd > /dev/null

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -e
if [ "$#" -eq 0 ]; then
echo "Usage: ./setup.sh <godot_branch_or_tag>"
echo
echo "e.g.:"
echo " ./setup.sh 3.4.4-stable"
echo " ./setup.sh master"
read version
exit 1
fi
branch=${1%/}
rm -rf godot
git clone --depth 1 https://github.com/godotengine/godot.git -b $branch
cp -r .idea godot
cp custom.py godot
cp -r ../spine-cpp/spine-cpp spine_godot
rm -rf example/.import
rm -rf example/.godot
./build.sh