Skip to content

Commit 32be2c1

Browse files
committed
[godot] Fix build script for Android template, closes #2657
1 parent 623e2b9 commit 32be2c1

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -214,3 +214,4 @@ spine-godot/compile_commands.json
214214
spine-godot/bin
215215
spine-godot/example-v4-extension/bin/macos/macos.framework/libspine_godot.macos.editor
216216
spine-godot/.idea
217+
spine-godot/build/version.txt

spine-godot/build/build-templates-v4.sh

+20-9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ fi
2626

2727
platform=${1%/}
2828
mono=false
29+
version=$(cat version.txt)
30+
major=$(echo $version | cut -d. -f1)
31+
minor=$(echo $version | cut -d. -f2)
2932

3033
if [[ $# -eq 2 ]]; then
3134
mono=${2%/}
@@ -171,15 +174,23 @@ elif [ "$platform" = "web" ]; then
171174
elif [ "$platform" = "android" ]; then
172175
# --- ANROID ---
173176
# generates android_release.apk, android_debug.apk, android_source.zip
174-
scons platform=android target=template_release android_arch=armv7 custom_modules="../spine_godot" --jobs=$cpus
175-
scons platform=android target=template_debug android_arch=armv7 custom_modules="../spine_godot" --jobs=$cpus
176-
scons platform=android target=template_release android_arch=arm64v8 custom_modules="../spine_godot" --jobs=$cpus
177-
scons platform=android target=template_debug android_arch=arm64v8 custom_modules="../spine_godot" --jobs=$cpus
178-
179-
pushd platform/android/java
180-
chmod a+x gradlew
181-
./gradlew generateGodotTemplates
182-
popd
177+
if [[ $major -lt 4 || ($major -eq 4 && $minor -lt 3) ]]; then
178+
# Godot < 4.3 generates APKs via Gradle invocation.
179+
scons platform=android target=template_release arch=arm32 custom_modules="../spine_godot" --jobs=$cpus
180+
scons platform=android target=template_debug arch=arm32 custom_modules="../spine_godot" --jobs=$cpus
181+
scons platform=android target=template_release arch=arm64 custom_modules="../spine_godot" --jobs=$cpus
182+
scons platform=android target=template_debug arch=arm64 custom_modules="../spine_godot" --jobs=$cpus
183+
184+
pushd platform/android/java
185+
chmod a+x gradlew
186+
./gradlew generateGodotTemplates
187+
popd
188+
else
189+
scons platform=android target=template_release arch=arm32 --jobs=$cpus
190+
scons platform=android target=template_release arch=arm64 generate_apk=yes --jobs=$cpus
191+
scons platform=android target=template_debug arch=arm32 --jobs=$cpus
192+
scons platform=android target=template_debug arch=arm64 generate_apk=yes --jobs=$cpus
193+
fi
183194
else
184195
echo "Unknown platform: $platform"
185196
exit 1

spine-godot/build/setup-extension.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if [ "$mono" != "true" ] && [ "$mono" != "false" ]; then
3333
exit 1
3434
fi
3535

36-
godot_cpp_branch=$(echo $godot_branch | cut -d- -f1)
36+
godot_cpp_branch=$(echo $godot_branch | cut -d. -f1-2)
3737

3838
cpus=2
3939
if [ "$OSTYPE" == "msys" ]; then

spine-godot/build/setup.sh

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ branch=${1%/}
2121
dev=${2%/}
2222
mono=false
2323
repo=https://github.com/godotengine/godot.git
24+
version=$(echo $branch | cut -d. -f1-2)
25+
echo $version > version.txt
2426

2527
if [[ $# -eq 3 && "$branch" != 3* ]]; then
2628
mono=${3%/}

0 commit comments

Comments
 (0)