From: Clifton Palmer Date: Sat, 8 Mar 2025 18:27:29 +0000 (-0600) Subject: Initial version X-Git-Tag: 0.1.0~4 X-Git-Url: http://git.purplebirdman.com/godot.git/commitdiff_plain/6e00fb582fbc29998b3dba68045518ff48915aac Initial version --- 6e00fb582fbc29998b3dba68045518ff48915aac diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..32d49da --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +download/ +project/ +debug/ +release/ diff --git a/script.sh b/script.sh new file mode 100755 index 0000000..4ccff45 --- /dev/null +++ b/script.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# gets a Godot release, fetches export templates, +# and builds a project with its native export options + +PWD=`pwd` +DIR_DOWNLOAD=$PWD/download +DIR_TEMPLATES=$DIR_DOWNLOAD/templates +DIR_DEBUG=$PWD/debug +DIR_RELEASE=$PWD/release +DIR_PROJECT=$PWD/project + +GODOT_VERSION=4.4-stable +GODOT_ZIP=Godot_v${GODOT_VERSION}_linux.x86_64.zip +GODOT_EXE=Godot_v${GODOT_VERSION}_linux.x86_64 +GODOT_URI=https://github.com/godotengine/godot/releases/download/$GODOT_VERSION/$GODOT_ZIP + +GODOT_EXPORT_TEMPLATES=Godot_v${GODOT_VERSION}_export_templates.tpz +GODOT_TEMPLATE_URI=https://github.com/godotengine/godot/releases/download/$GODOT_VERSION/$GODOT_EXPORT_TEMPLATES + +GODOT=$DIR_DOWNLOAD/$GODOT_EXE + +# get Godot +[[ -d $DIR_DOWNLOAD ]] || mkpath -p $DIR_DOWNLOAD +[[ -f $DIR_DOWNLOAD/$GODOT_ZIP ]] || wget -P $DIR_DOWNLOAD $GODOT_URI +[[ -f $DIR_DOWNLOAD/$GODOT_EXE ]] || unzip $DIR_DOWNLOAD/$GODOT_ZIP -d $DIR_DOWNLOAD + +echo Godot version - $($GODOT --headless --version) + +# get export templates +[[ -f $DIR_DOWNLOAD/$GODOT_EXPORT_TEMPLATES ]] || wget -P $DIR_DOWNLOAD $GODOT_TEMPLATE_URI +[[ -d $DIR_TEMPLATES ]] || unzip -d $DIR_DOWNLOAD $DIR_DOWNLOAD/$GODOT_EXPORT_TEMPLATES + +GODOT_TEMPLATE_VERSION=$(cat $DIR_TEMPLATES/version.txt) +LOCAL_TEMPLATES=$HOME/.local/share/godot/export_templates/$GODOT_TEMPLATE_VERSION +if [[ ! -d $LOCAL_TEMPLATES ]] +then + mkdir -p $LOCAL_TEMPLATES + cp $DIR_TEMPLATES/* $LOCAL_TEMPLATES + # TODO: leaves extra stuff +fi + +echo Godot export template version - $GODOT_TEMPLATE_VERSION +echo Local templates - $LOCAL_TEMPLATES + +# execute project build +PLATFORM=macOS +[[ -d $DIR_RELEASE/$PLATFORM ]] || mkdir -p $DIR_RELEASE/$PLATFORM +[[ -d $DIR_DEBUG/$PLATFORM ]] || mkdir -p $DIR_DEBUG/$PLATFORM + +echo Starting project build +$GODOT --headless --export-debug --path $DIR_PROJECT $PLATFORM $DIR_DEBUG/$PLATFORM/wolf-seeking-sheep.dmg