Pārlūkot izejas kodu

[godot] Rework build scripts for CI

Mario Zechner 3 gadi atpakaļ
vecāks
revīzija
f2c7ab3683

+ 1 - 0
.gitignore

@@ -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

+ 0 - 5
spine-godot/build.sh

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

+ 19 - 0
spine-godot/build/build-templates.sh

@@ -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

+ 0 - 0
spine-godot/build.bat → spine-godot/build/build.bat


+ 56 - 0
spine-godot/build/build.sh

@@ -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

+ 0 - 0
spine-godot/custom.py → spine-godot/build/custom.py


+ 0 - 0
spine-godot/livepp-v4.patch → spine-godot/build/livepp-v4.patch


+ 0 - 0
spine-godot/livepp.patch → spine-godot/build/livepp.patch


+ 0 - 0
spine-godot/setup.bat → spine-godot/build/setup.bat


+ 0 - 23
spine-godot/setup.sh

@@ -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