mirror of
https://github.com/godotengine/godot-build-scripts.git
synced 2026-01-04 02:09:44 +03:00
Cosmetic cleanup and slight refactoring
- Drop unused mandatory -t argument in build.sh. - Remove infinite retries for OSX and iOS, builds now seem to succeed right away and it prevents exiting the script. - Factor out iOS SDK version. - Make build order consistent in build.sh and build-release.sh - Removing trailing whitespace.
This commit is contained in:
committed by
Rémi Verschelde
parent
1ca485fa55
commit
e583fcba03
40
build.sh
40
build.sh
@@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
set -e
|
||||
|
||||
OPTIND=1
|
||||
|
||||
@@ -7,13 +8,12 @@ registry="registry.prehensile-tales.com"
|
||||
username=""
|
||||
password=""
|
||||
godot_version=""
|
||||
template_version=""
|
||||
git_treeish="master"
|
||||
force_download=0
|
||||
skip_download=0
|
||||
skip_git_checkout=0
|
||||
|
||||
while getopts "h?r:u:p:v:t:g:fsc" opt; do
|
||||
while getopts "h?r:u:p:v:g:fsc" opt; do
|
||||
case "$opt" in
|
||||
h|\?)
|
||||
echo "Usage: $0 [OPTIONS...]"
|
||||
@@ -22,7 +22,6 @@ while getopts "h?r:u:p:v:t:g:fsc" opt; do
|
||||
echo " -u username"
|
||||
echo " -p password"
|
||||
echo " -v godot version (e.g: 3.1-alpha5) [mandatory]"
|
||||
echo " -t template version (e.g 3.1.alpha) [mandatory]"
|
||||
echo " -g git treeish (e.g: master)"
|
||||
echo " -f force redownload of all images"
|
||||
echo " -s skip downloading"
|
||||
@@ -38,8 +37,6 @@ while getopts "h?r:u:p:v:t:g:fsc" opt; do
|
||||
;;
|
||||
v) godot_version=$OPTARG
|
||||
;;
|
||||
t) template_version=$OPTARG
|
||||
;;
|
||||
g) git_treeish=$OPTARG
|
||||
;;
|
||||
f) force_download=1
|
||||
@@ -72,20 +69,15 @@ if [ -z "${godot_version}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${template_version}" ]; then
|
||||
echo "-t <version> is mandatory!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -z "${username}" ] && [ ! -z "${password}" ]; then
|
||||
if ${podman} login ${registry} -u "${username}" -p "${password}"; then
|
||||
export logged_in=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $skip_download == 0 ]; then
|
||||
echo "Fetching images"
|
||||
for image in mono-glue windows ubuntu-32 ubuntu-64 javascript; do
|
||||
for image in mono-glue windows ubuntu-64 ubuntu-32 javascript; do
|
||||
if [ ${force_download} == 1 ] || ! ${podman} image exists godot/$image; then
|
||||
if ! ${podman} pull ${registry}/godot/${image}; then
|
||||
echo "ERROR: image $image does not exist and can't be downloaded"
|
||||
@@ -97,7 +89,7 @@ if [ $skip_download == 0 ]; then
|
||||
if [ ! -z "${logged_in}" ]; then
|
||||
echo "Fetching private images"
|
||||
|
||||
for image in uwp macosx ios android; do
|
||||
for image in macosx android ios uwp; do
|
||||
if [ ${force_download} == 1 ] || ! ${podman} image exists godot-private/$image; then
|
||||
if ! ${podman} pull ${registry}/godot-private/${image}; then
|
||||
echo "ERROR: image $image does not exist and can't be downloaded"
|
||||
@@ -113,9 +105,8 @@ if [ "${skip_git_checkout}" == 0 ]; then
|
||||
pushd git
|
||||
git checkout -b ${git_treeish} origin/${git_treeish} || git checkout ${git_treeish}
|
||||
git reset --hard
|
||||
git clean -fd
|
||||
git clean -fx
|
||||
git pull origin ${git_treeish}
|
||||
git clean -fdx
|
||||
git pull origin ${git_treeish} || /bin/true
|
||||
|
||||
git archive --format=tar $git_treeish --prefix=godot-${godot_version}/ | gzip > ../godot.tar.gz
|
||||
popd
|
||||
@@ -131,12 +122,12 @@ ${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedi
|
||||
mkdir -p ${basedir}/out/windows
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-windows:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/windows:/root/out -w /root/ ${registry}/godot/windows:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/windows
|
||||
|
||||
mkdir -p ${basedir}/out/linux/x86
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-linux:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/linux/x86:/root/out -w /root/ ${registry}/godot/ubuntu-32:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/linux32
|
||||
|
||||
mkdir -p ${basedir}/out/linux/x64
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-linux:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/linux/x64:/root/out -w /root/ ${registry}/godot/ubuntu-64:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/linux64
|
||||
|
||||
mkdir -p ${basedir}/out/linux/x86
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-linux:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/linux/x86:/root/out -w /root/ ${registry}/godot/ubuntu-32:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/linux32
|
||||
|
||||
mkdir -p ${basedir}/out/server/x64
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-server:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/server/x64:/root/out -w /root/ ${registry}/godot/ubuntu-64:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/server
|
||||
|
||||
@@ -146,16 +137,15 @@ ${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedi
|
||||
mkdir -p ${basedir}/out/macosx/x64
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-macosx:/root/build -v ${basedir}/mono-glue:/root/mono-glue -v ${basedir}/out/macosx/x64:/root/out -w /root/ ${registry}/godot-private/macosx:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/macosx
|
||||
|
||||
mkdir -p ${basedir}/out/uwp
|
||||
${podman} run --ulimit nofile=32768:32768 -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-uwp:/root/build -v ${basedir}/out/uwp:/root/out -w /root/ ${registry}/godot-private/uwp:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/uwp
|
||||
mkdir -p ${basedir}/out/android
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-android:/root/build -v ${basedir}/out/android:/root/out -w /root/ ${registry}/godot-private/android:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/android
|
||||
|
||||
mkdir -p ${basedir}/out/ios
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-ios:/root/build -v ${basedir}/out/ios:/root/out -w /root/ ${registry}/godot-private/ios:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/ios
|
||||
|
||||
mkdir -p ${basedir}/out/android
|
||||
${podman} run -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-android:/root/build -v ${basedir}/out/android:/root/out -w /root/ ${registry}/godot-private/android:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/android
|
||||
mkdir -p ${basedir}/out/uwp
|
||||
${podman} run --ulimit nofile=32768:32768 -it --rm -v ${basedir}/godot.tar.gz:/root/godot.tar.gz -v ${basedir}/build-uwp:/root/build -v ${basedir}/out/uwp:/root/out -w /root/ ${registry}/godot-private/uwp:latest bash build/build.sh 2>&1 | tee ${basedir}/out/logs/uwp
|
||||
|
||||
if [ ! -z "$SUDO_UID" ]; then
|
||||
chown -R "${SUDO_UID}":"${SUDO_GID}" ${basedir}/out
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user