mirror of
https://github.com/godotengine/godot-build-scripts.git
synced 2026-01-04 02:09:44 +03:00
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.
70 lines
1.5 KiB
Bash
Executable File
70 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
godot_version=""
|
|
templates_version=""
|
|
build_classical=1
|
|
build_mono=1
|
|
|
|
while getopts "h?v:t:b" opt; do
|
|
case "$opt" in
|
|
h|\?)
|
|
echo "Usage: $0 [OPTIONS...]"
|
|
echo
|
|
echo " -v public version (e.g. 3.2-stable) [mandatory]"
|
|
echo " -t templates version (e.g. 3.2.stable) [mandatory]"
|
|
echo " -b all|classical|mono (default: all)"
|
|
echo
|
|
exit 1
|
|
;;
|
|
v)
|
|
godot_version=$OPTARG
|
|
;;
|
|
t)
|
|
templates_version=$OPTARG
|
|
;;
|
|
b)
|
|
if [ "$OPTARG" == "classical" ]; then
|
|
build_mono=0
|
|
elif [ "$OPTARG" == "mono" ]; then
|
|
build_classical=0
|
|
fi
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if [ -z "${godot_version}" -o -z "${templates_version}" ]; then
|
|
echo "Mandatory argument -v or -t missing."
|
|
exit 1
|
|
fi
|
|
|
|
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}"
|
|
|
|
# Classical
|
|
|
|
if [ "${build_classical}" == "1" ]; then
|
|
echo "${templates_version}" > ${templatesdir}/version.txt
|
|
|
|
mkdir -p ${reldir}
|
|
zip -q -9 -r -D "${reldir}/${godot_basename}_export_templates.tpz" ${templatesdir}
|
|
fi
|
|
|
|
# Mono
|
|
|
|
if [ "${build_mono}" == "1" ]; then
|
|
echo "${templates_version}.mono" > ${templatesdir_mono}/version.txt
|
|
|
|
mkdir -p ${reldir_mono}
|
|
zip -q -9 -r -D "${reldir_mono}/${godot_basename}_mono_export_templates.tpz" ${templatesdir_mono}
|
|
fi
|
|
|
|
echo "Templates archives generated successfully"
|