Refactor build scripts to allow building only Classical or Mono

The in-container build scripts now get passed CLASSICAL and MONO env
variables which can be used to build one or the other, or both
(default).

`build.sh`, `build-release.sh` and `build-templates.sh` now all expect
command line switches to specify the version details, and optionally
which flavor to build.

For example to build Mono only:

  ./build.sh -v 3.2-beta4 -g master -b mono
  ./build-release.sh -v 3.2-beta4 -b mono
  ./build-templates.sh -v 3.2-beta4 -t 3.2.beta4 -b mono

Also took the opportunity to do some extra cleanup, like removing
unnecessary `builtin_*` options since they all default to True, even
for Linux in 3.2, as well as `use_lto` and `use_static_cpp` options
on platforms which don't implement them.

And I improved the `build-release.sh` script to be a bit easier to
read, and avoid having too many stray folders to cleanup.
The build scripts should now generate the final structure that we'd use
on the official mirrors, with the `mono` distribution as a subfolder of
the main release folder.
This commit is contained in:
Rémi Verschelde
2019-12-13 13:28:34 +01:00
parent 7b376804d7
commit 067d3f3a49
12 changed files with 774 additions and 556 deletions

View File

@@ -2,12 +2,7 @@
set -e
if [ -z $1 ]; then
echo "Usage: $0 <version>"
echo " For example: $0 3.0.3-rc3"
echo ""
exit 1
fi
# Config
# For signing keystore and password.
source ./config.sh
@@ -27,332 +22,358 @@ function sign {
mv $1-signed $1
}
export GODOT_VERSION=$1
godot_version=""
build_classical=1
build_mono=1
while getopts "h?v:b" opt; do
case "$opt" in
h|\?)
echo "Usage: $0 [OPTIONS...]"
echo
echo " -v godot version (e.g: 3.1-alpha5) [mandatory]"
echo " -b all|classical|mono (default: all)"
echo
exit 1
;;
v)
godot_version=$OPTARG
;;
b)
if [ "$OPTARG" == "classical" ]; then
build_mono=0
elif [ "$OPTARG" == "mono" ]; then
build_classical=0
fi
;;
esac
done
export basedir=$(pwd)
export reldir="${basedir}/releases/${godot_version}"
export reldir_mono="${reldir}/mono"
export tmpdir="${basedir}/tmp"
export templatesdir="${tmpdir}/templates"
export templatesdir_mono="${templatesdir}-mono"
export godot_basename="Godot_v${godot_version}"
# Cleanup and setup
rm -rf ${reldir}
rm -rf ${tmpdir}
mkdir -p ${reldir}
mkdir -p ${reldir_mono}
mkdir -p ${templatesdir}
mkdir -p ${templatesdir_mono}
# Tarball
mkdir -p release-${GODOT_VERSION}
rm -rf release-${GODOT_VERSION}/*.xz release-${GODOT_VERSION}/*.sha256
zcat godot.tar.gz | xz -c > release-${GODOT_VERSION}/godot-${GODOT_VERSION}.tar.xz
sha256sum release-${GODOT_VERSION}/godot-${GODOT_VERSION}.tar.xz > release-${GODOT_VERSION}/godot-${GODOT_VERSION}.tar.xz.sha256
zcat godot.tar.gz | xz -c > ${reldir}/godot-${godot_version}.tar.xz
pushd ${reldir}
sha256sum godot-${godot_version}.tar.xz > godot-${godot_version}.tar.xz.sha256
popd
# Classical
if [ "${build_classical}" == "1" ]; then
## Linux (Classical) ##
# Editor
binname="${godot_basename}_x11.64"
cp out/linux/x64/tools/godot.x11.opt.tools.64 ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
binname="${godot_basename}_x11.32"
cp out/linux/x86/tools/godot.x11.opt.tools.32 ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
# Templates
cp out/linux/x64/templates/godot.x11.opt.64 ${templatesdir}/linux_x11_64_release
cp out/linux/x64/templates/godot.x11.opt.debug.64 ${templatesdir}/linux_x11_64_debug
cp out/linux/x86/templates/godot.x11.opt.32 ${templatesdir}/linux_x11_32_release
cp out/linux/x86/templates/godot.x11.opt.debug.32 ${templatesdir}/linux_x11_32_debug
## Windows (Classical) ##
# Editor
binname="${godot_basename}_win64.exe"
cp out/windows/x64/tools/godot.windows.opt.tools.64.exe ${binname}
strip ${binname}
sign ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
binname="${godot_basename}_win32.exe"
cp out/windows/x86/tools/godot.windows.opt.tools.32.exe ${binname}
strip ${binname}
sign ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
# Templates
cp out/windows/x64/templates/godot.windows.opt.64.exe ${templatesdir}/windows_64_release.exe
cp out/windows/x64/templates/godot.windows.opt.debug.64.exe ${templatesdir}/windows_64_debug.exe
cp out/windows/x86/templates/godot.windows.opt.32.exe ${templatesdir}/windows_32_release.exe
cp out/windows/x86/templates/godot.windows.opt.debug.32.exe ${templatesdir}/windows_32_debug.exe
strip ${templatesdir}/windows*.exe
sign ${templatesdir}/windows_64_release.exe
sign ${templatesdir}/windows_64_debug.exe
sign ${templatesdir}/windows_32_release.exe
sign ${templatesdir}/windows_32_debug.exe
## OSX (Classical) ##
# Editor
binname="${godot_basename}_osx.64"
rm -rf Godot.app
cp -r git/misc/dist/osx_tools.app Godot.app
mkdir -p Godot.app/Contents/MacOS
cp out/macosx/x64/tools/godot.osx.opt.tools.64 Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
zip -q -9 -r "${reldir}/${binname}.zip" Godot.app
rm -rf Godot.app
# Templates
rm -rf osx_template.app
cp -r git/misc/dist/osx_template.app .
mkdir -p osx_template.app/Contents/MacOS
cp out/macosx/x64/templates/godot.osx.opt.64 osx_template.app/Contents/MacOS/godot_osx_release.64
cp out/macosx/x64/templates/godot.osx.opt.debug.64 osx_template.app/Contents/MacOS/godot_osx_debug.64
chmod +x osx_template.app/Contents/MacOS/godot_osx*
zip -q -9 -r "${templatesdir}/osx.zip" osx_template.app
rm -rf osx_template.app
## Server (Classical) ##
# Headless (editor)
binname="${godot_basename}_linux_headless.64"
cp out/server/x64/tools/godot_server.x11.opt.tools.64 ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
# Server (template)
binname="${godot_basename}_linux_server.64"
cp out/server/x64/templates/godot_server.x11.opt.64 ${binname}
zip -q -9 "${reldir}/${binname}.zip" ${binname}
rm ${binname}
## Javascript (Classical) ##
# Templates
cp out/javascript/templates/godot.javascript.opt.zip ${templatesdir}/webassembly_release.zip
cp out/javascript/templates/godot.javascript.opt.debug.zip ${templatesdir}/webassembly_debug.zip
## Android (Classical) ##
# Templates
cp out/android/templates/*.apk ${templatesdir}/
cp out/android/templates/android_source.zip ${templatesdir}/
## iOS (Classical) ##
rm -rf ios_xcode
cp -r git/misc/dist/ios_xcode ios_xcode
for suffix in "" "_arkit_module" "_camera_module"; do
cp out/ios/libgodot${suffix}.iphone.opt.fat ios_xcode/libgodot${suffix}.iphone.release.fat.a
cp out/ios/libgodot${suffix}.iphone.opt.debug.fat ios_xcode/libgodot${suffix}.iphone.debug.fat.a
done
chmod +x ios_xcode/libgodot*.iphone.*
cd ios_xcode
zip -q -9 -r "${templatesdir}/iphone.zip" *
cd ..
rm -rf ios_xcode
## UWP (Classical) ##
if [ ! -d "angle" ]; then
echo "Downloading ANGLE binaries from https://github.com/GodotBuilder/godot-builds/releases/tag/_tools"
curl -LO https://github.com/GodotBuilder/godot-builds/releases/download/_tools/angle.7z
7z x angle.7z && rm -f angle.7z
fi
rm -rf uwp_template_*
for arch in ARM Win32 x64; do
cp -r git/misc/dist/uwp_template uwp_template_${arch}
cp angle/winrt/10/src/Release_${arch}/libEGL.dll \
angle/winrt/10/src/Release_${arch}/libGLESv2.dll \
uwp_template_${arch}/
cp -r uwp_template_${arch} uwp_template_${arch}_debug
done
cp out/uwp/arm/godot.uwp.opt.32.arm.exe uwp_template_ARM/godot.uwp.exe
cp out/uwp/arm/godot.uwp.opt.debug.32.arm.exe uwp_template_ARM_debug/godot.uwp.exe
sign uwp_template_ARM/godot.uwp.exe
sign uwp_template_ARM_debug/godot.uwp.exe
cd uwp_template_ARM && zip -q -9 -r "${templatesdir}/uwp_arm_release.zip" * && cd ..
cd uwp_template_ARM_debug && zip -q -9 -r "${templatesdir}/uwp_arm_debug.zip" * && cd ..
rm -rf uwp_template_ARM*
cp out/uwp/x86/godot.uwp.opt.32.x86.exe uwp_template_Win32/godot.uwp.exe
cp out/uwp/x86/godot.uwp.opt.debug.32.x86.exe uwp_template_Win32_debug/godot.uwp.exe
sign uwp_template_Win32/godot.uwp.exe
sign uwp_template_Win32_debug/godot.uwp.exe
cd uwp_template_Win32 && zip -q -9 -r "${templatesdir}/uwp_x86_release.zip" * && cd ..
cd uwp_template_Win32_debug && zip -q -9 -r "${templatesdir}/uwp_x86_debug.zip" * && cd ..
rm -rf uwp_template_Win32*
cp out/uwp/x64/godot.uwp.opt.64.x64.exe uwp_template_x64/godot.uwp.exe
cp out/uwp/x64/godot.uwp.opt.debug.64.x64.exe uwp_template_x64_debug/godot.uwp.exe
sign uwp_template_x64/godot.uwp.exe
sign uwp_template_x64_debug/godot.uwp.exe
cd uwp_template_x64 && zip -q -9 -r "${templatesdir}/uwp_x64_release.zip" * && cd ..
cd uwp_template_x64_debug && zip -q -9 -r "${templatesdir}/uwp_x64_debug.zip" * && cd ..
rm -rf uwp_template_x64*
# Linux 64
mkdir -p templates
rm -f templates/linux_x11_64*
cp out/linux/x64/templates/godot.x11.opt.debug.64 templates/linux_x11_64_debug
cp out/linux/x64/templates/godot.x11.opt.64 templates/linux_x11_64_release
mkdir -p release-${GODOT_VERSION}
rm -f release-${GODOT_VERSION}/*linux*64*
cp out/linux/x64/tools/godot.x11.opt.tools.64 Godot_v${GODOT_VERSION}_x11.64
zip -q -9 Godot_v${GODOT_VERSION}_x11.64.zip Godot_v${GODOT_VERSION}_x11.64
mv Godot_v${GODOT_VERSION}_x11.64.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_x11.64
mkdir -p mono/release-${GODOT_VERSION}
rm -rf mono/release-${GODOT_VERSION}/*linux*64*
mkdir -p Godot_v${GODOT_VERSION}_mono_x11_64
cp out/linux/x64/tools-mono/godot.x11.opt.tools.64.mono Godot_v${GODOT_VERSION}_mono_x11_64/Godot_v${GODOT_VERSION}_mono_x11.64
cp -rp out/linux/x64/tools-mono/GodotSharp Godot_v${GODOT_VERSION}_mono_x11_64
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_x11_64.zip Godot_v${GODOT_VERSION}_mono_x11_64
mv Godot_v${GODOT_VERSION}_mono_x11_64.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_x11_64
mkdir -p mono/templates
rm -rf mono/templates/*linux*64*
cp -rp out/linux/x64/templates-mono/data.mono.x11.64.* mono/templates/
cp out/linux/x64/templates-mono/godot.x11.opt.debug.64.mono mono/templates/linux_x11_64_debug
cp out/linux/x64/templates-mono/godot.x11.opt.64.mono mono/templates/linux_x11_64_release
# Linux 32
mkdir -p templates
rm -f templates/linux_x11_32*
cp out/linux/x86/templates/godot.x11.opt.debug.32 templates/linux_x11_32_debug
cp out/linux/x86/templates/godot.x11.opt.32 templates/linux_x11_32_release
mkdir -p release-${GODOT_VERSION}
rm -f release-${GODOT_VERSION}/*linux*32*
cp out/linux/x86/tools/godot.x11.opt.tools.32 Godot_v${GODOT_VERSION}_x11.32
zip -q -9 Godot_v${GODOT_VERSION}_x11.32.zip Godot_v${GODOT_VERSION}_x11.32
mv Godot_v${GODOT_VERSION}_x11.32.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_x11.32
mkdir -p mono/release-${GODOT_VERSION}
rm -rf mono/release-${GODOT_VERSION}/*linux*32*
mkdir -p Godot_v${GODOT_VERSION}_mono_x11_32
cp out/linux/x86/tools-mono/godot.x11.opt.tools.32.mono Godot_v${GODOT_VERSION}_mono_x11_32/Godot_v${GODOT_VERSION}_mono_x11.32
cp -rp out/linux/x86/tools-mono/GodotSharp/ Godot_v${GODOT_VERSION}_mono_x11_32
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_x11_32.zip Godot_v${GODOT_VERSION}_mono_x11_32
mv Godot_v${GODOT_VERSION}_mono_x11_32.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_x11_32
mkdir -p mono/templates
rm -rf mono/templates/*linux*32*
cp -rp out/linux/x86/templates-mono/data.mono.x11.32.* mono/templates/
cp out/linux/x86/templates-mono/godot.x11.opt.debug.32.mono mono/templates/linux_x11_32_debug
cp out/linux/x86/templates-mono/godot.x11.opt.32.mono mono/templates/linux_x11_32_release
# Windows
mkdir -p release-${GODOT_VERSION}
rm -f release-${GODOT_VERSION}/*win*zip
cp out/windows/x64/tools/godot.windows.opt.tools.64.exe Godot_v${GODOT_VERSION}_win64.exe
strip Godot_v${GODOT_VERSION}_win64.exe
sign Godot_v${GODOT_VERSION}_win64.exe
zip -q -9 Godot_v${GODOT_VERSION}_win64.exe.zip Godot_v${GODOT_VERSION}_win64.exe
mv Godot_v${GODOT_VERSION}_win64.exe.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_win64.exe
cp out/windows/x86/tools/godot.windows.opt.tools.32.exe Godot_v${GODOT_VERSION}_win32.exe
strip Godot_v${GODOT_VERSION}_win32.exe
sign Godot_v${GODOT_VERSION}_win32.exe
zip -q -9 Godot_v${GODOT_VERSION}_win32.exe.zip Godot_v${GODOT_VERSION}_win32.exe
mv Godot_v${GODOT_VERSION}_win32.exe.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_win32.exe
mkdir -p templates
rm -rf templates/*win*
cp out/windows/x64/templates/godot.windows.opt.64.exe templates/windows_64_release.exe
cp out/windows/x64/templates/godot.windows.opt.debug.64.exe templates/windows_64_debug.exe
cp out/windows/x86/templates/godot.windows.opt.32.exe templates/windows_32_release.exe
cp out/windows/x86/templates/godot.windows.opt.debug.32.exe templates/windows_32_debug.exe
strip templates/windows*.exe
sign templates/windows_64_release.exe
sign templates/windows_64_debug.exe
sign templates/windows_32_release.exe
sign templates/windows_32_debug.exe
mkdir -p mono/release-${GODOT_VERSION}
rm -rf mono/release-${GODOT_VERSION}/*win*
mkdir -p mono/templates
rm -rf mono/templates/*win*
mkdir -p Godot_v${GODOT_VERSION}_mono_win64
cp out/windows/x64/tools-mono/godot.windows.opt.tools.64.mono.exe Godot_v${GODOT_VERSION}_mono_win64/Godot_v${GODOT_VERSION}_mono_win64.exe
strip Godot_v${GODOT_VERSION}_mono_win64/Godot_v${GODOT_VERSION}_mono_win64.exe
sign Godot_v${GODOT_VERSION}_mono_win64/Godot_v${GODOT_VERSION}_mono_win64.exe
cp -rp out/windows/x64/tools-mono/GodotSharp Godot_v${GODOT_VERSION}_mono_win64
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_win64.zip Godot_v${GODOT_VERSION}_mono_win64
mv Godot_v${GODOT_VERSION}_mono_win64.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_win64
cp -rp out/windows/x64/templates-mono/data.mono.windows.64.* mono/templates/
cp out/windows/x64/templates-mono/godot.windows.opt.debug.64.mono.exe mono/templates/windows_64_debug.exe
cp out/windows/x64/templates-mono/godot.windows.opt.64.mono.exe mono/templates/windows_64_release.exe
mkdir -p Godot_v${GODOT_VERSION}_mono_win32
cp out/windows/x86/tools-mono/godot.windows.opt.tools.32.mono.exe Godot_v${GODOT_VERSION}_mono_win32/Godot_v${GODOT_VERSION}_mono_win32.exe
strip Godot_v${GODOT_VERSION}_mono_win32/Godot_v${GODOT_VERSION}_mono_win32.exe
sign Godot_v${GODOT_VERSION}_mono_win32/Godot_v${GODOT_VERSION}_mono_win32.exe
cp -rp out/windows/x86/tools-mono/GodotSharp Godot_v${GODOT_VERSION}_mono_win32
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_win32.zip Godot_v${GODOT_VERSION}_mono_win32
mv Godot_v${GODOT_VERSION}_mono_win32.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_win32
cp -rp out/windows/x86/templates-mono/data.mono.windows.32.* mono/templates/
cp out/windows/x86/templates-mono/godot.windows.opt.debug.32.mono.exe mono/templates/windows_32_debug.exe
cp out/windows/x86/templates-mono/godot.windows.opt.32.mono.exe mono/templates/windows_32_release.exe
strip mono/templates/windows*.exe
sign mono/templates/windows_64_debug.exe
sign mono/templates/windows_64_release.exe
sign mono/templates/windows_32_debug.exe
sign mono/templates/windows_32_release.exe
# OSX
mkdir -p templates
rm -f templates/osx*
rm -rf osx_template
mkdir -p osx_template
cd osx_template
cp -r ../git/misc/dist/osx_template.app .
mkdir osx_template.app/Contents/MacOS
cp ../out/macosx/x64/templates/godot.osx.opt.64 osx_template.app/Contents/MacOS/godot_osx_release.64
cp ../out/macosx/x64/templates/godot.osx.opt.debug.64 osx_template.app/Contents/MacOS/godot_osx_debug.64
chmod +x osx_template.app/Contents/MacOS/godot_osx*
zip -q -9 -r osx.zip osx_template.app
cd ..
mv osx_template/osx.zip templates
rm -rf osx_template
mkdir -p release-${GODOT_VERSION}
rm -f release-${GODOT_VERSION}/*osx*
cp -r git/misc/dist/osx_tools.app Godot.app
mkdir -p Godot.app/Contents/MacOS
cp out/macosx/x64/tools/godot.osx.opt.tools.64 Godot.app/Contents/MacOS/Godot
chmod +x Godot.app/Contents/MacOS/Godot
zip -q -9 -r "release-${GODOT_VERSION}/Godot_v${GODOT_VERSION}_osx.64.zip" Godot.app
rm -rf Godot.app
mkdir -p mono/templates
rm -rf mono/templates/osx*
rm -rf osx_template
mkdir -p osx_template
cd osx_template
cp -r ../git/misc/dist/osx_template.app .
mkdir osx_template.app/Contents/MacOS
cp ../out/macosx/x64/templates-mono/godot.osx.opt.64.mono osx_template.app/Contents/MacOS/godot_osx_release.64
cp ../out/macosx/x64/templates-mono/godot.osx.opt.debug.64.mono osx_template.app/Contents/MacOS/godot_osx_debug.64
cp -rp ../out/macosx/x64/templates-mono/data.mono.osx.64.* osx_template.app/Contents/MacOS/
chmod +x osx_template.app/Contents/MacOS/godot_osx*
zip -q -9 -r osx.zip osx_template.app
cd ..
mv osx_template/osx.zip mono/templates
rm -rf osx_template
mkdir -p mono/release-${GODOT_VERSION}
rm -f mono/release-${GODOT_VERSION}/*osx*
cp -r git/misc/dist/osx_tools.app Godot_mono.app
mkdir -p Godot_mono.app/Contents/MacOS
cp out/macosx/x64/tools-mono/godot.osx.opt.tools.64.mono Godot_mono.app/Contents/MacOS/Godot
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp/Mono
cp -rp out/macosx/x64/tools-mono/GodotSharp/Api Godot_mono.app/Contents/Frameworks/GodotSharp
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/lib Godot_mono.app/Contents/Frameworks/GodotSharp/Mono
cp -rp out/macosx/x64/tools-mono/GodotSharp/Tools Godot_mono.app/Contents/Frameworks/GodotSharp
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/etc Godot_mono.app/Contents/Resources/GodotSharp/Mono
chmod +x Godot_mono.app/Contents/MacOS/Godot
zip -q -9 -r "mono/release-${GODOT_VERSION}/Godot_v${GODOT_VERSION}_mono_osx.64.zip" Godot_mono.app
rm -rf Godot_mono.app
# Server
cp out/server/x64/templates/godot_server.x11.opt.64 Godot_v${GODOT_VERSION}_linux_server.64
zip -q -9 Godot_v${GODOT_VERSION}_linux_server.64.zip Godot_v${GODOT_VERSION}_linux_server.64
mv Godot_v${GODOT_VERSION}_linux_server.64.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_linux_server.64
cp out/server/x64/tools/godot_server.x11.opt.tools.64 Godot_v${GODOT_VERSION}_linux_headless.64
zip -q -9 Godot_v${GODOT_VERSION}_linux_headless.64.zip Godot_v${GODOT_VERSION}_linux_headless.64
mv Godot_v${GODOT_VERSION}_linux_headless.64.zip release-${GODOT_VERSION}
rm Godot_v${GODOT_VERSION}_linux_headless.64
mkdir -p Godot_v${GODOT_VERSION}_mono_linux_server_64
cp out/server/x64/templates/godot_server.x11.opt.64.mono Godot_v${GODOT_VERSION}_mono_linux_server_64/Godot_v${GODOT_VERSION}_mono_linux_server.64
cp -rp out/server/x64/templates/data.mono.server.64.release Godot_v${GODOT_VERSION}_mono_linux_server_64/data_Godot_v${GODOT_VERSION}_mono_linux_server
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_linux_server_64.zip Godot_v${GODOT_VERSION}_mono_linux_server_64
mv Godot_v${GODOT_VERSION}_mono_linux_server_64.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_linux_server_64
mkdir -p Godot_v${GODOT_VERSION}_mono_linux_headless_64
cp out/server/x64/tools/godot_server.x11.opt.tools.64.mono Godot_v${GODOT_VERSION}_mono_linux_headless_64/Godot_v${GODOT_VERSION}_mono_linux_headless.64
cp -rp out/server/x64/tools/GodotSharp Godot_v${GODOT_VERSION}_mono_linux_headless_64
zip -r -q -9 Godot_v${GODOT_VERSION}_mono_linux_headless_64.zip Godot_v${GODOT_VERSION}_mono_linux_headless_64
mv Godot_v${GODOT_VERSION}_mono_linux_headless_64.zip mono/release-${GODOT_VERSION}
rm -rf Godot_v${GODOT_VERSION}_mono_linux_headless_64
# Javascript
cp out/javascript/templates/godot.javascript.opt.zip templates/webassembly_release.zip
cp out/javascript/templates/godot.javascript.opt.debug.zip templates/webassembly_debug.zip
mkdir -p mono/templates
cp out/javascript/templates-mono/godot.javascript.opt.mono.zip mono/templates/webassembly_release.zip
cp out/javascript/templates-mono/godot.javascript.opt.debug.mono.zip mono/templates/webassembly_debug.zip
mkdir -p mono/templates/bcl
cp -r out/javascript/templates-mono/bcl/wasm mono/templates/bcl/
# Android
cp out/android/templates/*.apk templates
cp out/android/templates/android_source.zip templates
cp out/android/templates-mono/*.apk mono/templates
cp out/android/templates-mono/android_source.zip mono/templates
mkdir -p mono/templates/bcl
cp -r out/android/templates-mono/bcl/monodroid mono/templates/bcl/
# iOS
cp -r git/misc/dist/ios_xcode ios_xcode
cp out/ios/libgodot.iphone.opt.fat ios_xcode/libgodot.iphone.release.fat.a
cp out/ios/libgodot.iphone.opt.debug.fat ios_xcode/libgodot.iphone.debug.fat.a
cp out/ios/libgodot_arkit_module.iphone.opt.fat ios_xcode/libgodot_arkit_module.iphone.release.fat.a
cp out/ios/libgodot_arkit_module.iphone.opt.debug.fat ios_xcode/libgodot_arkit_module.iphone.debug.fat.a
cp out/ios/libgodot_camera_module.iphone.opt.fat ios_xcode/libgodot_camera_module.iphone.release.fat.a
cp out/ios/libgodot_camera_module.iphone.opt.debug.fat ios_xcode/libgodot_camera_module.iphone.debug.fat.a
chmod +x ios_xcode/libgodot*.iphone.*
cd ios_xcode
zip -q -9 -r ../templates/iphone.zip *
cd ..
rm -rf ios_xcode
# UWP
if [ ! -d "angle" ]; then
echo "Downloading ANGLE binaries from https://github.com/GodotBuilder/godot-builds/releases/tag/_tools"
curl -LO https://github.com/GodotBuilder/godot-builds/releases/download/_tools/angle.7z
7z x angle.7z && rm -f angle.7z
fi
mkdir -p templates
rm -f templates/uwp*
rm -rf uwp_template_*
# Mono
for arch in ARM Win32 x64; do
cp -r git/misc/dist/uwp_template uwp_template_${arch}
if [ "${build_mono}" == "1" ]; then
cp angle/winrt/10/src/Release_${arch}/libEGL.dll \
angle/winrt/10/src/Release_${arch}/libGLESv2.dll \
uwp_template_${arch}/
cp -r uwp_template_${arch} uwp_template_${arch}_debug
done
## Linux (Mono) ##
cp out/uwp/arm/godot.uwp.opt.32.arm.exe uwp_template_ARM/godot.uwp.exe
cp out/uwp/arm/godot.uwp.opt.debug.32.arm.exe uwp_template_ARM_debug/godot.uwp.exe
sign uwp_template_ARM/godot.uwp.exe
sign uwp_template_ARM_debug/godot.uwp.exe
cd uwp_template_ARM && zip -q -9 -r ../templates/uwp_arm_release.zip * && cd ..
cd uwp_template_ARM_debug && zip -q -9 -r ../templates/uwp_arm_debug.zip * && cd ..
# Editor
binbasename="${godot_basename}_mono_x11"
mkdir -p ${binbasename}_64
cp out/linux/x64/tools-mono/godot.x11.opt.tools.64.mono ${binbasename}_64/${binbasename}.64
cp -rp out/linux/x64/tools-mono/GodotSharp ${binbasename}_64/
zip -r -q -9 "${reldir_mono}/${binbasename}_64.zip" ${binbasename}_64
rm -rf ${binbasename}_64
cp out/uwp/x86/godot.uwp.opt.32.x86.exe uwp_template_Win32/godot.uwp.exe
cp out/uwp/x86/godot.uwp.opt.debug.32.x86.exe uwp_template_Win32_debug/godot.uwp.exe
sign uwp_template_Win32/godot.uwp.exe
sign uwp_template_Win32_debug/godot.uwp.exe
cd uwp_template_Win32 && zip -q -9 -r ../templates/uwp_x86_release.zip * && cd ..
cd uwp_template_Win32_debug && zip -q -9 -r ../templates/uwp_x86_debug.zip * && cd ..
binbasename="${godot_basename}_mono_x11"
mkdir -p ${binbasename}_32
cp out/linux/x86/tools-mono/godot.x11.opt.tools.32.mono ${binbasename}_32/${binbasename}.32
cp -rp out/linux/x86/tools-mono/GodotSharp/ ${binbasename}_32/
zip -r -q -9 "${reldir_mono}/${binbasename}_32.zip" ${binbasename}_32
rm -rf ${binbasename}_32
cp out/uwp/x64/godot.uwp.opt.64.x64.exe uwp_template_x64/godot.uwp.exe
cp out/uwp/x64/godot.uwp.opt.debug.64.x64.exe uwp_template_x64_debug/godot.uwp.exe
sign uwp_template_x64/godot.uwp.exe
sign uwp_template_x64_debug/godot.uwp.exe
cd uwp_template_x64 && zip -q -9 -r ../templates/uwp_x64_release.zip * && cd ..
cd uwp_template_x64_debug && zip -q -9 -r ../templates/uwp_x64_debug.zip * && cd ..
# Templates
cp -rp out/linux/x64/templates-mono/data.mono.x11.64.* ${templatesdir_mono}/
cp out/linux/x64/templates-mono/godot.x11.opt.debug.64.mono ${templatesdir_mono}/linux_x11_64_debug
cp out/linux/x64/templates-mono/godot.x11.opt.64.mono ${templatesdir_mono}/linux_x11_64_release
cp -rp out/linux/x86/templates-mono/data.mono.x11.32.* ${templatesdir_mono}/
cp out/linux/x86/templates-mono/godot.x11.opt.debug.32.mono ${templatesdir_mono}/linux_x11_32_debug
cp out/linux/x86/templates-mono/godot.x11.opt.32.mono ${templatesdir_mono}/linux_x11_32_release
rm -rf uwp_template_*
## Windows (Mono) ##
exit 0
# Editor
binname="${godot_basename}_mono_win64"
mkdir -p ${binname}
cp out/windows/x64/tools-mono/godot.windows.opt.tools.64.mono.exe ${binname}/${binname}.exe
strip ${binname}/${binname}.exe
sign ${binname}/${binname}.exe
cp -rp out/windows/x64/tools-mono/GodotSharp ${binname}/
zip -r -q -9 "${reldir_mono}/${binname}.zip" ${binname}
rm -rf ${binname}
binname="${godot_basename}_mono_win32"
mkdir -p ${binname}
cp out/windows/x86/tools-mono/godot.windows.opt.tools.32.mono.exe ${binname}/${binname}.exe
strip ${binname}/${binname}.exe
sign ${binname}/${binname}.exe
cp -rp out/windows/x86/tools-mono/GodotSharp ${binname}/
zip -r -q -9 "${reldir_mono}/${binname}.zip" ${binname}
rm -rf ${binname}
# Templates
cp -rp out/windows/x64/templates-mono/data.mono.windows.64.* ${templatesdir_mono}/
cp out/windows/x64/templates-mono/godot.windows.opt.debug.64.mono.exe ${templatesdir_mono}/windows_64_debug.exe
cp out/windows/x64/templates-mono/godot.windows.opt.64.mono.exe ${templatesdir_mono}/windows_64_release.exe
cp -rp out/windows/x86/templates-mono/data.mono.windows.32.* ${templatesdir_mono}/
cp out/windows/x86/templates-mono/godot.windows.opt.debug.32.mono.exe ${templatesdir_mono}/windows_32_debug.exe
cp out/windows/x86/templates-mono/godot.windows.opt.32.mono.exe ${templatesdir_mono}/windows_32_release.exe
strip ${templatesdir_mono}/windows*.exe
sign ${templatesdir_mono}/windows_64_debug.exe
sign ${templatesdir_mono}/windows_64_release.exe
sign ${templatesdir_mono}/windows_32_debug.exe
sign ${templatesdir_mono}/windows_32_release.exe
## OSX (Mono) ##
# Editor
binname="${godot_basename}_mono_osx.64"
rm -rf Godot_mono.app
cp -r git/misc/dist/osx_tools.app Godot_mono.app
mkdir -p Godot_mono.app/Contents/MacOS
cp out/macosx/x64/tools-mono/godot.osx.opt.tools.64.mono Godot_mono.app/Contents/MacOS/Godot
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp
mkdir -p Godot_mono.app/Contents/{Frameworks,Resources}/GodotSharp/Mono
cp -rp out/macosx/x64/tools-mono/GodotSharp/Api Godot_mono.app/Contents/Frameworks/GodotSharp
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/lib Godot_mono.app/Contents/Frameworks/GodotSharp/Mono
cp -rp out/macosx/x64/tools-mono/GodotSharp/Tools Godot_mono.app/Contents/Frameworks/GodotSharp
cp -rp out/macosx/x64/tools-mono/GodotSharp/Mono/etc Godot_mono.app/Contents/Resources/GodotSharp/Mono
chmod +x Godot_mono.app/Contents/MacOS/Godot
zip -q -9 -r "${reldir_mono}/${binname}.zip" Godot_mono.app
rm -rf Godot_mono.app
# Templates
rm -rf osx_template.app
cp -r git/misc/dist/osx_template.app .
mkdir -p osx_template.app/Contents/MacOS
cp out/macosx/x64/templates-mono/godot.osx.opt.debug.64.mono osx_template.app/Contents/MacOS/godot_osx_debug.64
cp out/macosx/x64/templates-mono/godot.osx.opt.64.mono osx_template.app/Contents/MacOS/godot_osx_release.64
cp -rp out/macosx/x64/templates-mono/data.mono.osx.64.* osx_template.app/Contents/MacOS/
chmod +x osx_template.app/Contents/MacOS/godot_osx*
zip -q -9 -r "${templatesdir_mono}/osx.zip" osx_template.app
rm -rf osx_template.app
## Server (Mono) ##
# Headless (editor)
binbasename="${godot_basename}_mono_linux_headless"
mkdir -p ${binbasename}_64
cp out/server/x64/tools-mono/godot_server.x11.opt.tools.64.mono ${binbasename}_64/${binbasename}.64
cp -rp out/server/x64/tools-mono/GodotSharp ${binbasename}_64/
zip -r -q -9 "${reldir_mono}/${binbasename}_64.zip" ${binbasename}_64
rm -rf ${binbasename}_64
# Server (template)
binbasename="${godot_basename}_mono_linux_server"
mkdir -p ${binbasename}_64
cp out/server/x64/templates-mono/godot_server.x11.opt.64.mono ${binbasename}_64/${binbasename}.64
cp -rp out/server/x64/templates-mono/data.mono.server.64.release ${binbasename}_64/data_${binbasename}_64
zip -r -q -9 "${reldir_mono}/${binbasename}_64.zip" ${binbasename}_64
rm -rf ${binbasename}_64
## Javascript (Mono) ##
# Templates
cp out/javascript/templates-mono/godot.javascript.opt.debug.mono.zip ${templatesdir_mono}/webassembly_debug.zip
cp out/javascript/templates-mono/godot.javascript.opt.mono.zip ${templatesdir_mono}/webassembly_release.zip
mkdir -p ${templatesdir_mono}/bcl
cp -r out/javascript/templates-mono/bcl/wasm ${templatesdir_mono}/bcl/
## Android (Mono) ##
# Templates
cp out/android/templates-mono/*.apk ${templatesdir_mono}/
cp out/android/templates-mono/android_source.zip ${templatesdir_mono}/
mkdir -p ${templatesdir_mono}/bcl
cp -r out/android/templates-mono/bcl/monodroid ${templatesdir_mono}/bcl/
## iOS (Mono) ##
# Not supported yet.
## UWP (Mono) ##
# Not supported yet.
fi
echo "All editor binaries and templates prepared successfully for release"