[godot] Fix build script for Android template, closes #2657

This commit is contained in:
Mario Zechner 2024-10-23 11:21:48 +02:00
parent 623e2b9786
commit 32be2c1ef1
4 changed files with 23 additions and 9 deletions

1
.gitignore vendored
View File

@ -214,3 +214,4 @@ spine-godot/compile_commands.json
spine-godot/bin
spine-godot/example-v4-extension/bin/macos/macos.framework/libspine_godot.macos.editor
spine-godot/.idea
spine-godot/build/version.txt

View File

@ -26,6 +26,9 @@ fi
platform=${1%/}
mono=false
version=$(cat version.txt)
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)
if [[ $# -eq 2 ]]; then
mono=${2%/}
@ -171,15 +174,23 @@ elif [ "$platform" = "web" ]; then
elif [ "$platform" = "android" ]; then
# --- ANROID ---
# generates android_release.apk, android_debug.apk, android_source.zip
scons platform=android target=template_release android_arch=armv7 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_debug android_arch=armv7 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_release android_arch=arm64v8 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_debug android_arch=arm64v8 custom_modules="../spine_godot" --jobs=$cpus
if [[ $major -lt 4 || ($major -eq 4 && $minor -lt 3) ]]; then
# Godot < 4.3 generates APKs via Gradle invocation.
scons platform=android target=template_release arch=arm32 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_debug arch=arm32 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_release arch=arm64 custom_modules="../spine_godot" --jobs=$cpus
scons platform=android target=template_debug arch=arm64 custom_modules="../spine_godot" --jobs=$cpus
pushd platform/android/java
chmod a+x gradlew
./gradlew generateGodotTemplates
popd
else
scons platform=android target=template_release arch=arm32 --jobs=$cpus
scons platform=android target=template_release arch=arm64 generate_apk=yes --jobs=$cpus
scons platform=android target=template_debug arch=arm32 --jobs=$cpus
scons platform=android target=template_debug arch=arm64 generate_apk=yes --jobs=$cpus
fi
else
echo "Unknown platform: $platform"
exit 1

View File

@ -33,7 +33,7 @@ if [ "$mono" != "true" ] && [ "$mono" != "false" ]; then
exit 1
fi
godot_cpp_branch=$(echo $godot_branch | cut -d- -f1)
godot_cpp_branch=$(echo $godot_branch | cut -d. -f1-2)
cpus=2
if [ "$OSTYPE" == "msys" ]; then

View File

@ -21,6 +21,8 @@ branch=${1%/}
dev=${2%/}
mono=false
repo=https://github.com/godotengine/godot.git
version=$(echo $branch | cut -d. -f1-2)
echo $version > version.txt
if [[ $# -eq 3 && "$branch" != 3* ]]; then
mono=${3%/}