Skip to content

Instantly share code, notes, and snippets.

@ericwomer
Last active May 14, 2020 19:51
Show Gist options
  • Save ericwomer/93e142f20765b04578afc66469542abf to your computer and use it in GitHub Desktop.
Save ericwomer/93e142f20765b04578afc66469542abf to your computer and use it in GitHub Desktop.
#!/bin/bash
# USage: cd to your Unreal Projects root dir
# ./ue4stage.sh ProjectFolder and it will
# stage and build for you your project
function pause(){
read -p "$*"
}
PROJECT_NAME="${1%/}"
PROJECT_FILE="${PROJECT_NAME}.uproject"
# EDIT ME!
# May change PROJECT_ROOT_DIR=`pwd`
# Change these options manualy to reflect your setup.
# And also make sure these folders exist.
PROJECT_ROOT_DIR="$(pwd)"
PROJECT_STAGING_ROOT_DIR="/store/Stage"
PROJECT_BUILD_CONFIG="Shipping"
PROJECT_PLATFORM="Linux"
UNREAL_ENGINE_ROOT_DIR="/store/UE4_25"
#LD_LIBRARY_PATH=":.:"
#export LD_LIBRARY_PATH
echo "PROJECT_NAME:" ${PROJECT_NAME}
echo "PROJECT_ROOT_DIR:" ${PROJECT_ROOT_DIR}
echo "PROJECT_STAGING_ROOT_DIR:" ${PROJECT_STAGING_ROOT_DIR}
echo "UNREAL_ENGINE_ROOT_DIR:" ${UNREAL_ENGINE_ROOT_DIR}
echo "PROJECT_FILE" "${PROJECT_NAME}"
echo "PROJECT_STAGING_ROOT_DIR/PROJECT_NAME:" "${PROJECT_STAGING_ROOT_DIR}/${PROJECT_NAME}"
echo "PATH_TO_BIN_FOLDER:" "${PROJECT_STAGING_ROOT_DIR}/${PROJECT_NAME}/${PATH_TO_BIN_FOLDER}"
echo "PROJECT_BUILD_CONFIG: " "${PROJECT_BUILD_CONFIG}"
echo "PROJECT_PLATFORM: " "${PROJECT_PLATFORM}"
pause 'Press [Enter] key to continue...'
cd "${UNREAL_ENGINE_ROOT_DIR}"
Engine/Build/BatchFiles/RunUAT.sh BuildCookRun -noP4 -project="${PROJECT_ROOT_DIR}/${PROJECT_FILE}" \
-clientconfig="${PROJECT_BUILD_CONFIG}" -nocompileedtior -utf8output -platform="${PROJECT_PLATFORM}" \
-build -cook -map= -pak -createreleaseversion=1234 -ue4exe=UE4Editor -manifests -distribution \
-compressed -nocleanstage -stage -stagingdirecotry="${PROJECT_STAGING_ROOT_DIR}/${PROJECT_NAME}" \
-package -NoSign -targetplatform=${PROJECT_PLATFORM} -crashreporter
# options I removed -LinuxNoEditor (may not actually be needed)
# Add if your building a server: -server -serverconfig=${PROJECT_BUILD_CONFIG} -serverplatform=${PROJECT_PLATFORM}
# ?? Add if your building non monolithic: -stagenonmonolithic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment