-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathubuild
executable file
·97 lines (84 loc) · 2.11 KB
/
ubuild
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
set -e
execName=$0
function printHelp {
execName=$1
echo "Usage: "
echo " $execName [-u projectfile.uproject] [-p platform] [-t buildtarget]"
echo ""
echo " -u|--uproject Project file to build. Defaults to any .uproject file found in current directory."
echo " -p|--platform Target platform of build. Defaults to the platform that this script is running on."
echo " -t|--target Build target to use. Defaults to Development."
}
projectFile=""
platform=""
buildTarget=""
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-u|--uproject)
projectFile="$2"
shift # past argument
shift # past value
;;
--uproject=*)
projectFile="${i#*=}"
shift # past argument
;;
-p|--platform)
platform="$2"
shift # past argument
shift # past value
;;
--platform=*)
platform="${i#*=}"
shift # past argument
;;
-t|--target)
buildTarget="$2"
shift # past argument
shift # past value
;;
--target=*)
buildTarget="${i#*=}"
shift # past argument
;;
-h|--help)
printHelp $execName
exit 0
;;
*) # unknown option
echo "Unknown argument: $key"
printHelp $execName
exit 1
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
BASE_PATH="/Users/Shared/Epic Games/UE_4.21/Engine/Build/BatchFiles/Mac"
# Set defaults
if [ "$projectFile" = "" ]
then
projectFile="$(pwd)/$(ls *.uproject)"
fi
if [ "$platform" = "" ]
then
if [[ "$OSTYPE" == "linux-gnu" ]]; then
platform="Linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
platform="Mac"
fi
fi
if [ "$buildTarget" = "" ]
then
buildTarget="Development"
fi
projectFile=$(realpath $projectFile)
projectName=$(echo $(basename "$projectFile") | sed 's/.uproject//g')
# this is located inside an extra 'Mac' path unlike the Windows variant.
. "$BASE_PATH/SetupMono.sh" "$BASE_PATH"
# pass all parameters to UBT
#mono "$BASE_PATH/../../../Binaries/DotNET/UnrealBuildTool.exe" -projectfiles $projectName $platform $buildTarget "$projectFile"
mono "$BASE_PATH/../../../Binaries/DotNET/UnrealBuildTool.exe" "$projectName"Editor $platform $buildTarget "$projectFile" -rocket