File size: 6,492 Bytes
7fd553e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
98
99
<?xml version='1.0' ?>
<BuildGraph xmlns="http://www.epicgames.com/BuildGraph" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.epicgames.com/BuildGraph ../Schema.xsd" >

	<Option Name="EditorCompileArgs" DefaultValue="" Description="Arguments to be used for EditorTarget Compile"/>
	<Option Name="ExtraToolCompileArguments" DefaultValue="" Description="Arguments to be used for Tool Compile"/>
	<Option Name="ExtraTargetCompileArguments" DefaultValue="" Description="Arguments to be used for Client Compile"/>
	<Option Name="TargetPlatforms" Restrict="[^ ]*" DefaultValue="Win64" Description="List of the target platforms to build for, separated by semicolons, eg. Win64;Win32;Android"/>
	<Option Name="OutputDir" DefaultValue="$(RootDir)\LocalBuilds\LyraBinaries" Description ="Output directory for compiled binaries"/>
	<Option Name="Versioned" Restrict="true|false" DefaultValue="$(IsBuildMachine)" Description="Whether to embed changelist number into binaries"/>
	<Option Name="PCBSubmitPath" Restrict="(?://.*)?" DefaultValue="" Description="Where in Perforce to submit the PCBs to."/>
	<Option Name="PreflightChange" Restrict="\d*" DefaultValue="" Description="The shelved changelist number in a preflight build; empty otherwise"/>
	<Property Name="IsPreflight" Value="true" If="'$(PreflightChange)' != ''"/>
	<Property Name="IsPreflight" Value="false" If="'$(PreflightChange)' == ''"/>

	<EnvVar Name="COMPUTERNAME"/>
	<EnvVar Name="P4CLIENT"/>

	<Agent Name="Submit Lyra PCBs" Type="CompileWin64;Win64">
	
		<!-- Update the engine version files -->
		<Node Name="Update Version Files">
			<SetVersion Change="$(Change)" Branch="$(EscapedBranch)" If="$(Versioned)"/>
		</Node>
		
		<!-- Compile the tool executables -->
		<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
			<Compile Target="ShaderCompileWorker" Platform="Win64" Configuration="Development" Arguments="$(ExtraToolCompileArguments)" Tag="#ToolBinaries"/>
			<Compile Target="UnrealLightmass" Platform="Win64" Configuration="Development" Arguments="$(ExtraToolCompileArguments)" Tag="#ToolBinaries"/>
			<Compile Target="UnrealPak" Platform="Win64" Configuration="Development" Arguments="$(ExtraToolCompileArguments)" Tag="#ToolBinaries"/>
			<Compile Target="CrashReportClientEditor" Configuration="Shipping" Platform="Win64" Arguments="$(ExtraToolCompileArguments)" Tag="#ToolBinaries"/>
			<Compile Target="UnrealInsights" Platform="Win64" Configuration="Shipping" Arguments="$(ExtraToolCompileArguments)" Tag="#ToolBinaries"/>
			
			<!-- 

				This exe is a copy of ShaderCompileWorker.exe, created as a post-build step. See \Engine\Source\Programs\ShaderCompileWorker\ShaderCompileWorker.Target.cs.

				It's needed for shader compilation to work with Incredibuild.

			-->
			<Tag Files="$(RootDir)\Engine\Binaries\Win64\XGEControlWorker.exe" With="#ToolBinaries"/>
		</Node>
		
		<!-- Compile the editor executable -->
		<Node Name="Compile LyraEditor Win64" Requires="Compile Tools Win64" Produces="#EditorBinaries">
			<Compile Target="LyraEditor" Platform="Win64" Configuration="Development" Tag="#EditorBinaries" Arguments="$(EditorCompileArgs)"/>
		</Node>
		
		<!-- Compile the game targets -->
		<Property Name="GameBinaries" Value=""/>
		<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
			<Node Name="Compile LyraGame $(TargetPlatform)" Requires="Compile Tools Win64" Produces="#GameBinaries_LyraGame_$(TargetPlatform)">
				<Compile Target="LyraGame" Platform="$(TargetPlatform)" Configuration="Development" Arguments="$(ExtraTargetCompileArguments)" Tag="#GameBinaries_LyraGame_$(TargetPlatform)"/>
				<Compile Target="LyraGame" Platform="$(TargetPlatform)" Configuration="Shipping" Arguments="$(ExtraTargetCompileArguments)" Tag="#GameBinaries_LyraGame_$(TargetPlatform)"/>
			</Node>
			<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_LyraGame_$(TargetPlatform);"/>
		</ForEach>
		
		<!-- Copy all the files to the output directory -->
		<Node Name="Tag Output Files" Requires="#ToolBinaries;#EditorBinaries;$(GameBinaries)" Produces="#OutputFiles">
			<Tag Files="#ToolBinaries;#EditorBinaries;$(GameBinaries)" Except=".../Intermediate/..." With="#OutputFiles"/>
		</Node>

		<!-- Copy all the files to the output directory -->
		<Node Name="Copy To Staging Directory" Requires="#OutputFiles">
			<Delete Files="$(OutputDir)/..."/>
			<Copy Files="#OutputFiles" From="$(RootDir)" To="$(OutputDir)"/>
		</Node>

		<!-- Create a zip archive and submit that to Perforce for use by UGS -->
		<Node Name="Submit To Perforce For UGS" Requires="#OutputFiles">
			<!-- Clear out the archive directory -->
			<Property Name="ArchiveDir" Value="$(RootDir)\LocalBuilds\ArchiveForUGS"/>
			<Delete Files="$(ArchiveDir)\..."/>

			<!-- Tag required files from UAT and UBT that will already have been built -->
			<Tag Files="Engine/Source/Programs/AutomationTool/..." Filter="*.csproj" With="#UAT Projects"/>
			<CsCompile Project="#UAT Projects" Configuration="Development" Platform="AnyCPU" Tag="#ArchiveFiles" EnumerateOnly="true"/>

			<!-- Partition all the binaries and symbols -->
			<Tag Files="#OutputFiles" Except=".../Intermediate/..." With="#ArchiveFiles"/>
			<Tag Files="#ArchiveFiles" Except="*.pdb" With="#ArchiveBinaries"/>
			<Tag Files="#ArchiveFiles" Filter="*.pdb" With="#ArchiveSymbols"/>

			<!-- Stage all the files to be archived -->
			<Property Name="ArchiveStagingDir" Value="$(ArchiveDir)\Staging"/>
			<Copy Files="#ArchiveBinaries" From="$(RootDir)" To="$(ArchiveStagingDir)"/>
			<Strip Files="#ArchiveSymbols" BaseDir="$(RootDir)" OutputDir="$(ArchiveStagingDir)" Platform="Win64"/>

			<!-- Create the zip file and submit it to Perforce -->
			<Property Name="ArchivePerforceDir" Value="$(ArchiveDir)\Perforce"/>
			<Property Name="ArchiveFile" Value="$(ArchivePerforceDir)\$(EscapedBranch)-LyraEditor.zip"/>
			<Zip FromDir="$(ArchiveStagingDir)" ZipFile="$(ArchiveFile)"/>
			<Property Name="SubmitClient" Value="$(COMPUTERNAME)_ArchiveForUGS"/>
			<Property Name="SubmitClient" Value="$(P4CLIENT)_ArchiveForUGS" If="$(IsBuildMachine)"/>
			<Submit Description="[CL $(CodeChange)] Updated binaries" Files="$(ArchiveFile)" FileType="binary+FS32" Workspace="$(SubmitClient)" Stream="$(PCBSubmitPath)" RootDir="$(ArchivePerforceDir)"/>
		</Node>
		
	</Agent>

</BuildGraph>