From 72cb43458ae70b80297b2383c2e82497756a22f1 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Wed, 29 Jun 2022 08:51:16 +0200 Subject: [PATCH] [godot] More build script work. --- spine-godot/build/build.sh | 40 ++++++++++++++------------------------ spine-godot/build/setup.sh | 33 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 spine-godot/build/setup.sh diff --git a/spine-godot/build/build.sh b/spine-godot/build/build.sh index 9202e0b91..dfa64a5bb 100755 --- a/spine-godot/build/build.sh +++ b/spine-godot/build/build.sh @@ -5,43 +5,33 @@ dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" pushd $dir > /dev/null if [ ! "$#" -eq 0 ] && [ ! "$#" -eq 2 ]; then - echo "Usage: ./build.sh " + echo "Usage: ./build.sh " echo echo "e.g.:" - echo " ./build.sh 3.4.4-stable true" - echo " ./build.sh master master" - echo - echo "If no arguments are given" + echo " ./build.sh release_debug" + echo " ./build.sh debug" + echo read version exit 1 fi -if [ "$#" -eq 0 ] && [ ! -d ../godot ]; then - echo "No Godot clone found. Run ./build.sh first." +if [ "$#" -eq 0 ]; then + echo "Please specify a target, either 'debug' or 'release_debug'" + exit 1 +fi + +if [ ! -d ../godot ]; then + echo "No Godot clone found. Run ./setup.sh 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 +if [ "${2}" = "true" ]; then + target="target=debug" +else + target="" fi -cp -r ../spine-cpp/spine-cpp spine_godot -popd pushd ../godot diff --git a/spine-godot/build/setup.sh b/spine-godot/build/setup.sh new file mode 100644 index 000000000..94035e28a --- /dev/null +++ b/spine-godot/build/setup.sh @@ -0,0 +1,33 @@ +#!/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: ./setup.sh " + echo + echo "e.g.:" + echo " ./setup.sh 3.4.4-stable true" + echo " ./setup.sh master false" + echo + read version + exit 1 +fi + +branch=${1%/} +dev=${2%/} + +pushd .. +rm -rf godot +git clone --depth 1 https://github.com/godotengine/godot.git -b $branch +if [ $dev = "true" ]; then + cp -r .idea godot + cp build/custom.py godot + rm -rf example/.import + rm -rf example/.godot +fi +cp -r ../spine-cpp/spine-cpp spine_godot +popd + +popd > /dev/null \ No newline at end of file