-
Notifications
You must be signed in to change notification settings - Fork 7
/
cook_dlc.sh
executable file
·67 lines (52 loc) · 2.44 KB
/
cook_dlc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -o errexit
BASED_ON_RELEASE_VERSION=$1 # Default value is "1.0"
PROJECT_NAME=$2 # By default it takes the name of the current folder
DLC_NAME=$3 # Default value is "DLC_based_on_{version it's based on}_{timestamp}"
# Required env variables
PROJECT_ROOT=$UE4_GAMS
UE4_PATH=$UE4_ROOT
if [ -z "$PROJECT_ROOT" ] || [ -z "$UE4_PATH" ]
then
echo "ERROR! Absolute path to UE4 and/or to project are missing. "
echo "Required environmental variables are not defined or have different names!"
echo "Modify this script (Lines 8-9) to point to the desired variables."
exit 1
fi
if [ -z "$BASED_ON_RELEASE_VERSION" ]
then
BASED_ON_RELEASE_VERSION=1.0
fi
if [ -z "$PROJECT_NAME" ]
then
PROJECT_NAME="${PWD##*/}"
echo "======="
echo "Project name not specified!"
echo "Default name is: $PROJECT_NAME"
fi
if [ -z "$DLC_NAME" ]
then
DLC_NAME="DLC_based_on_${BASED_ON_RELEASE_VERSION}_$(date +%s)"
fi
"$UE4_PATH"/Engine/Build/BatchFiles/RunUAT.sh -ScriptsForProject="$PROJECT_ROOT"/"$PROJECT_NAME".uproject BuildCookRun \
-project="$PROJECT_ROOT"/"$PROJECT_NAME".uproject -noP4 -clientconfig=Development -serverconfig=Development -nocompileeditor \
-ue4exe=UE4Editor -utf8output -platform=Linux -targetplatform=Linux -build -cook -map= -unversionedcookedcontent -pak -dlcname=LoadMap \
-DLCIncludeEngineContent -basedonreleaseversion=$BASED_ON_RELEASE_VERSION -stagebasereleasepaks -stage -compressed
mv "$PROJECT_ROOT"/Plugins/LoadMap/Saved/StagedBuilds/LinuxNoEditor/"$PROJECT_NAME"/Plugins/LoadMap/Content/Paks/LinuxNoEditor/LoadMap"${PROJECT_NAME}"-LinuxNoEditor.pak \
"$PROJECT_ROOT"/Plugins/LoadMap/Saved/StagedBuilds/LinuxNoEditor/"$PROJECT_NAME"/Plugins/LoadMap/Content/Paks/LinuxNoEditor/"${DLC_NAME}".pak
cp "$PROJECT_ROOT"/Plugins/LoadMap/Saved/StagedBuilds/LinuxNoEditor/"$PROJECT_NAME"/Plugins/LoadMap/Content/Paks/LinuxNoEditor/"${DLC_NAME}".pak \
"$PROJECT_ROOT"/out/LinuxNoEditor/"$PROJECT_NAME"/Content/Paks/
DLC_SIZE=$(du -h "$PROJECT_ROOT"/Plugins/LoadMap/Saved/StagedBuilds/LinuxNoEditor/"$PROJECT_NAME"/Plugins/LoadMap/Content/Paks/LinuxNoEditor/"${DLC_NAME}".pak)
rm -r "$PROJECT_ROOT"/Plugins/LoadMap/Saved
cat <<EOT
SUMMARY
===============
Script executed with params: cook_dlc.sh $BASED_ON_RELEASE_VERSION $PROJECT_NAME $DLC_NAME
Based on release version: $BASED_ON_RELEASE_VERSION
Project name: $PROJECT_NAME
DLC name: $DLC_NAME
DLC size and path: $DLC_SIZE
Project root path: $PROJECT_ROOT
UE4 root path: $UE4_PATH
=======
EOT