File size: 23,902 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
<?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 ../../../../Engine/Build/Graph/Schema.xsd" >

	<!-- TODO NDarnell Add documentation -->
	<!-- "-Target=BuildAndTestInternalExtended Lyra" -->


	<!-- Project Info -->
	<!-- @TODO: Can we derive these somehow instead of hardcoding them? Will be an issue when turned into a launcher sample. -->
	<Property Name="ProjectName" Value="Lyra" />
	<Property Name="ProjectPath" Value="Samples/Games/Lyra" />
	<Option Name="TargetName" DefaultValue="LyraGame" Restrict="LyraGame|LyraGameEOS|LyraGameSteam|LyraGameSteamEOS" Description="The project target configuration we're building, like if we're building Lyra with EOS (Epic Online Services) compiled in." />
	

	<Property Name="Versioned" Value="$(IsBuildMachine)" />
	<Property Name="PublishHashedStagingData" Value="$(IsBuildMachine)" />

	<Property Name="IncludeEpicWebHelperInToolCompile" Value="true" />

	<Option Name="UploadArtifactId" DefaultValue="" Description="ID of the artifact to chunked and uploaded. Upload is ignored if no ID is specified." />
	<Option Name="UploadTargetPlatform" DefaultValue="" Description="Platform build to upload, i.e. Win64" />
	<Option Name="UploadConfiguration" DefaultValue="" Description="Configuration to upload, if applicable." />
	<Option Name="UploadLaunchArgs" DefaultValue="" Description="Arguments to be passed when launching the uploaded app."/>

	<Option Name="SkipUpdateAuditCollections" DefaultValue="false" Description="Whether to skip updating the audit collections (showing which files got cooked)" />

	<Option Name="SymbolServerPath" DefaultValue="" Description="A shared symbols server for your office, debugging shipped builds."/>
	
	<Option Name="RunAllCookTests" DefaultValue="false" Description="To run all cook tests"/>
	<Option Name="RunCookOnTheFlyTest" DefaultValue="$(RunAllCookTests)" Description="To run cook on the fly test"/>
	<Option Name="RunCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run cook by the book test"/>
	<Option Name="RunFastCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run fast cook by the book test"/>
	<Option Name="RunColdCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run cold cook by the book test"/>
	<Option Name="RunCookByTheBookCacheSettingsTest" DefaultValue="$(RunAllCookTests)" Description="To run cook by the book test with changed Data Cache Settings"/>
	<Option Name="RunUnversionedCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run unversioned cook by the book test"/>
	<Option Name="RunIterativeCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run iterative cook by the book test without launching a client, no map needed"/>
	<Option Name="RunInterruptedCookByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run interrupted cook by the book test without launching a client, no map needed"/>
	<Option Name="RunCookSinglePackageByTheBookTest" DefaultValue="$(RunAllCookTests)" Description="To run the cook by the book test with cooksinglepackagenorefs parameter, it is required to specify a map name and the WorldPartitionMap parameter if a map is WorldPartition"/>
	<Option Name="RunProjectTests" DefaultValue="false" Description="To run all tests under the Project Group"/>
	
	<Option Name="SourceBuildVersion" DefaultValue="" Description="The source build version for diffing"/>
	
	<!-- Turn off defaults so we can set out own -->
	<Property Name="WithBATDefaults" Value="false" />

	<!-- Set defaults for people running this script with no arguments. These can still be overriden with -set:TargetPlatforms= etc) -->
	<Property Name="DefaultEditorPlatforms" Value="Win64" />
	<Property Name="DefaultTargetPlatforms" Value="Win64"/>
	<Property Name="DefaultTargetConfigurations" Value="Development" />
	<Property Name="DefaultEditorTestList" Value="" />
	<Property Name="DefaultTargetTestList" Value="" />
	<Property Name="NetworkTempRootOverride" Value="" />
	<Property Name="NetworkPublishRootOverride" Value="" />
	<Property Name="NetworkReportRootOverride" Value="" />
	<Property Name="WithInterchangeWorker" Value="true" />

	<!-- If a build machine, turn off all defaults. Settings should be specified via the website UI -->
	<Do If="$(IsBuildMachine)">
		<Property Name="DefaultEditorPlatforms" Value="" />
		<Property Name="DefaultTargetPlatforms" Value=""/>
		<Property Name="DefaultTargetConfigurations" Value="" />
		<Property Name="DefaultEditorTestList" Value="" />
		<Property Name="DefaultTargetTestList" Value="" />
	</Do>

	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.CookOnTheFly(Map=L_Expanse)" If="$(RunCookOnTheFlyTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.CookByTheBook(Map=L_Expanse)" If="$(RunCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.FastCookByTheBook(Map=L_Expanse)" If="$(RunFastCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.ColdCookByTheBook(Map=L_Expanse)" If="$(RunColdCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.CookByTheBookCacheSettings(Map=L_Expanse)" If="$(RunCookByTheBookCacheSettingsTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.UnversionedCookByTheBook(Map=L_Expanse)" If="$(RunUnversionedCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.IterativeCookByTheBook" If="$(RunIterativeCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.InterruptedCookByTheBook" If="$(RunInterruptedCookByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.CookSinglePackageByTheBook(Map=L_Expanse, WorldPartitionMap)" If="$(RunCookSinglePackageByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.CookSinglePackageByTheBook(Map=L_ShooterGym)" If="$(RunCookSinglePackageByTheBookTest)" />
	<Property Name="DefaultTargetTestList" Value="$(DefaultTargetTestList)+UE.TargetAutomation(RunTest=Group:Project)" If="$(RunProjectTests)" />
	<Property Name="DefaultEditorTestList" Value="$(DefaultEditorTestList)+UE.EditorAutomation(RunTest=Group:Project)" If="$(RunProjectTests)" />

	<Property Name="ExtraStageAndPackageArguments" Value="-target=&quot;$(TargetName)&quot; -compressed -CrashReporter" />

	<!-- Property Name="CheckBuildSizePlatforms" Value="Android:425000" /-->

	<!-- =============================================================================== -->
	<!-- Setup -->
	<!-- =============================================================================== -->

	<!-- Configure specific AutomatedPerfTest runs -->
	<Include Script="../../../../Engine/Plugins/Performance/AutomatedPerfTesting/Build/Inc/AutomatedPerfTestProjectSettings.xml" />
	<Do If="'$(ReplayName)' == ''">
		<Property Name="ReplayName" Value="$(RootDir)/Samples/Games/Lyra/Build/Replays/LyraSample.replay" />
	</Do>

	<!-- Common Setting Overrides -->
	<Property Name="GauntletSettingsFile" Value="$(RootDir)/Samples/Games/Lyra/Build/GauntletSettings.xml" />

	<!-- This will declare an aggregate called BuildAndTest Lyra -->
	<Include Script="../../../../Engine/Build/Graph/Tasks/BuildAndTestProject.xml" />

	<!-- Add BuildAndTest project target node as the base requirement.  We append items to BuildAndTestExtendedRequirements, that need to be performed. -->
	<Property Name="BuildAndTestExtendedRequirements" Value="BuildAndTest $(ProjectName)" />

	<!-- =============================================================================== -->
	<!-- CONTENT VALIDATION -->
	<!-- =============================================================================== -->
	
	<Do If="ContainsItem('$(RequiredEditorPlatforms)', 'Win64', '+')">
		<Agent Name="$(ProjectName) Content Validation" Type="Win64">
			<Node Name="$(ProjectName) Content Validation" Requires="$(PreNodeName)Compile Editor Win64">
				<Property Name="RefExtensionsTypelist" Value=".uasset,.umap,.cpp,.c,.h,.inl,.ini,.uproject,.uplugin,.json"/>

				<Property Name="CLArgs" Value="-CL=$(Change) -LastGoodContentCLPath=$(NetworkOutputDirectory)/AutoTest/LastGoodContentCL"/>
				<Property Name="CLArgs" Value="-CL=$(PreflightChange) -shelved -SkipPrevCLFileExport" If="$(IsPreflight)" />
				<Property Name="CLArgs" Value="-opened" If="!$(IsBuildMachine)" />

				<Property Name="CheckAssetReferencesArgs" Value="-Branch=$(Branch) $(CLArgs) -ExtTypeList=&quot;$(RefExtensionsTypelist)&quot; -MaxPackagesToLoad=3000" />
				<Command Name="LyraContentValidation" Arguments="$(CheckAssetReferencesArgs)"/>
			</Node>
			<Label Category="Test" Name="Content Validation" Requires="$(ProjectName) Content Validation" />
		</Agent>

		<Do If="!$(SkipTest)">
			<!-- Append Content Validation to the list of things to do -->
			<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(ProjectName) Content Validation"/>
		</Do>
	</Do>

	<!-- =============================================================================== -->
	<!-- LOCALIZATION -->
	<!-- =============================================================================== -->
	<Option Name="SkipLocalization" DefaultValue="false" Description="Should we skip performing a localization gather?"/>
	
	<Do If="!$(SkipLocalization) and ContainsItem('$(RequiredEditorPlatforms)', 'Win64', '+')">

		<Property Name="ProjectsIncludedInLocalization" Value="Game,EngineOverrides"/>
		
		<!-- This an example setup for using either XLoc or Crowdin providers to localize your game. -->
		
		<!-- XLoc Example -->

		<Option Name="XLoc_Server" DefaultValue="" Description="XLoc Server"/>
		<Option Name="XLoc_APIKey" DefaultValue="" Description="XLoc API Key"/>
		<Option Name="XLoc_APISecret" DefaultValue="" Description="XLoc API Secret"/>
		<Option Name="XLoc_LocalizationId" DefaultValue="" Description="XLoc LocalizationId"/>		
		<Option Name="XLoc_AgentType" DefaultValue="Loc;Win64" Description="XLoc Agent Type"/>

		<Do If="'$(XLoc_Server)' != '' And '$(XLoc_APIKey)' != '' And '$(XLoc_APISecret)' != '' And '$(XLoc_LocalizationId)' != ''">
			<Agent Name="Localization" Type="$(XLoc_AgentType)">
				<Node Name="$(ProjectName) Localize" Requires="$(PreNodeName)Compile Editor Win64">
					<Command Name="Localize" Arguments="-LocalizationProvider=XLoc_Sample -UEProjectDirectory=$(ProjectPath) -UEProjectName=$(ProjectName) -LocalizationProjectNames=$(ProjectsIncludedInLocalization) -LocalizationBranch=&quot;$(EscapedBranch)&quot; -Server=&quot;$(XLoc_Server)&quot; -APIKey=&quot;$(XLoc_APIKey)&quot; -APISecret=&quot;$(XLoc_APISecret)&quot; -LocalizationId=&quot;$(XLoc_LocalizationId)&quot;" />
				</Node>
			</Agent>

			<!-- Append Localize to the list of things to do. -->
			<Label Category="Localize" Name="Localize" Requires="$(ProjectName) Localize" />
			<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(ProjectName) Localize"/>
		</Do>

		<!-- Smartling Example -->
		<Option Name="Smartling_ProjectId" DefaultValue="" Description="Smartling ProjectId"/>
		<Option Name="Smartling_UserId" DefaultValue="" Description="Smartling User Id"/>
		<Option Name="Smartling_APISecret" DefaultValue="" Description="Smartling API Secret"/>
		<Do If="'$(Smartling_ProjectId)' != '' And '$(Smartling_UserId)' != '' And '$(Smartling_APISecret)' != ''">
			<Agent Name="Localization" Type="$(XLoc_AgentType)">
				<Node Name="$(ProjectName) Localize" Requires="$(PreNodeName)Compile Editor Win64">
					<Command Name="Localize" Arguments="-LocalizationProvider=Smartling_Sample -UEProjectDirectory=$(ProjectPath) -UEProjectName=$(ProjectName) -LocalizationProjectNames=$(ProjectsIncludedInLocalization) -LocalizationBranch=&quot;$(EscapedBranch)&quot; -SmartlingProjectId=&quot;$(Smartling_ProjectId)&quot; -SmartlingUserId=&quot;$(Smartling_UserId)&quot; -SmartlingAPISecret=&quot;$(Smartling_APISecret)&quot;" />
				</Node>
			</Agent>

			<!-- Append Localize to the list of things to do. -->
			<Label Category="Localize" Name="Localize" Requires="$(ProjectName) Localize" />
			<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(ProjectName) Localize"/>
		</Do>


		<!-- Crowdin Example -->

		<Option Name="Crowdin_ProjectId" DefaultValue="" Description="Crowdin ProjectId"/>
		<Option Name="Crowdin_AccessToken" DefaultValue="" Description="Crowdin AccessToken"/>

		<Do If="'$(Crowdin_ProjectId)' != '' And '$(Crowdin_AccessToken)' != ''">
			<Agent Name="Localization" Type="$(XLoc_AgentType)">
				<Node Name="$(ProjectName) Localize" Requires="$(PreNodeName)Compile Editor Win64">
					<Command Name="Localize" Arguments="-LocalizationProvider=Crowdin_Sample -UEProjectDirectory=$(ProjectPath) -UEProjectName=$(ProjectName) -LocalizationProjectNames=$(ProjectsIncludedInLocalization) -LocalizationBranch=&quot;$(EscapedBranch)&quot; -ProjectId=&quot;$(Crowdin_ProjectId)&quot; -AccessToken=&quot;$(Crowdin_AccessToken)&quot;" />
				</Node>
			</Agent>

			<!-- Append Localize to the list of things to do. -->
			<Label Category="Localize" Name="Localize" Requires="$(ProjectName) Localize" />
			<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(ProjectName) Localize"/>
		</Do>

	</Do>
	
	<!-- =============================================================================== -->
	<!-- UPDATE ASSET AUDIT COLLECTIONS -->
	<!-- =============================================================================== -->

	<Do If="!$(SkipUpdateAuditCollections) and ContainsItem('$(TargetPlatforms)', 'Win64', '+')">
		<Agent Name="UpdateAuditCollections" Type="Win64">
			<Node Name="$(ProjectName) UpdateAuditCollections" After="$(PreNodeName)Stage Win64" Produces="#AuditInCookCollection">
				<Property Name="UpdateAuditCollectionsArgs" Value="" />
				<Copy Files="Manifest_UFSFiles_Win64.txt" From="$(NetworkOutputDirectory)/Windows/Staged" To="$(RootDir)/Engine/Programs/AutomationTool/Saved"/>
				<Command Name="Lyra_UpdateAuditCollections" Arguments="$(UpdateAuditCollectionsArgs)"/>
				<Tag Files="$(RootDir)/$(ProjectPath)/Content/Collections/Audit_InCook.collection" With="#AuditInCookCollection"/>
			</Node>
			<Label Category="Clients" Name="UpdateAuditCollections" Requires="$(ProjectName) UpdateAuditCollections"/>
		</Agent>
		<!-- Append Update Audit Collections to the list of things to do -->
		<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(ProjectName) UpdateAuditCollections"/>
	</Do>

	<!-- =============================================================================== -->
	<!-- DEPLOY TO EPIC GAME STORE -->
	<!-- =============================================================================== -->

	<Option Name="EpicGameStore_BuildPackageTool_Credentials_Path" DefaultValue="" Description="Epic Games Store's Build Package File Credentials File Path"/>

	<Do If="'$(UploadArtifactId)' != '' And '$(EpicGameStore_BuildPackageTool_Credentials_Path)' != ''">

		<Warning If="!Exists('$(EpicGameStore_BuildPackageTool_Credentials_Path)')" Message="EpicGameStore BuildPackageTool Credentials File Not Found!" />
		<Warning If="UploadTargetPlatform == ''" Message="You did not specify the 'UploadTargetPlatform' for the deploying to the Epic Game Store." />

		<!-- Declare the property, for some reason I have to do it outside the agent? -->
		<Property Name="UploadNodeName" Value="" />
			
		<Agent Name="Upload $(TargetName)" Type="Win64">
			<Property Name="PublishNodeName" Value="$(PreNodeName)Publish Staged $(UploadTargetPlatform)" />
			<Property Name="PublishNodeName" Value="$(PublishNodeName) (Horde)" If="$(Horde)"/>
		
			<!-- Set UploadPlatform since it isn't always the same as the target -->
			<Property Name="UploadPlatform" Value="$(UploadTargetPlatform)" />
			<Property Name="UploadPlatform" Value="Windows" If="'$(UploadTargetPlatform)' == 'Win64'"/>

			<Property Name="UploadNodeName" Value="$(ProjectName) Upload $(TargetName) $(UploadTargetPlatform)" />
		
			<Node Name="$(UploadNodeName)" Requires="$(PublishNodeName)">
				<Property Name="ConfigurationSuffix" Value="" />
				<Property Name="ConfigurationSuffix" Value="-$(UploadTargetPlatform)-$(UploadConfiguration)" If="'$(UploadConfiguration)' != 'Development' and '$(UploadConfiguration)' != ''" />	
				<Property Name="Launch" Value="$(ProjectName)/Binaries/$(UploadTargetPlatform)/$(TargetName)$(ConfigurationSuffix).exe"/>

				<!-- Copy published files to local agent and tag them for upload -->
				<Switch>
					<Case If="$(Horde)">
						<RetrieveArtifact Name="$(ProjectName)-Staged-$(UploadPlatform)" Type="staged-build" OutputDir="$(ProjectOutputDirectory)/$(UploadPlatform)" />
					</Case>
					<Default>
						<Copy From="$(NetworkOutputDirectory)/$(UploadPlatform)/Staged/..." To="$(ProjectOutputDirectory)/$(UploadPlatform)/..."  />
					</Default>
				</Switch>
				<Tag Files="$(ProjectOutputDirectory)/$(UploadPlatform)/..." Except="*.pdb" With="#MainGameFiles"/>
				<Tag Files="$(ProjectOutputDirectory)/$(UploadPlatform)/..." Filter="*.pdb" With="#MainGameSymbols"/>
				<Delete Files="#MainGameSymbols"/>
				
				<Property Name="BuildRoot" Value="$(ProjectOutputDirectory)/$(UploadPlatform)"/>
				<Property Name="CloudDir" Value="$(ProjectOutputDirectory)/CloudDir/$(UploadPlatform)"/>
				<Property Name="AppLaunch" Value="$(Launch)"/>
				<Property Name="AppArgs" Value="-installed -GpuPreference=0"/>
				<Property Name="FileAttributeList" Value=""/>
				<Property Name="FileIgnoreList" Value=""/>
				<Property Name="Label" Value="Live"/>
				<Property Name="Platform" Value="Windows"/>
				<Property Name="CommandLineFile" Value="$(EpicGameStore_BuildPackageTool_Credentials_Path)"/>
			
				<Command Name="DeployToEpicGameStore" Arguments="-ArtifactId=&quot;$(UploadArtifactId)&quot; -BuildRoot=&quot;$(BuildRoot)&quot; -CloudDir=&quot;$(CloudDir)&quot; -BuildVersion=&quot;$(BuildVersion)&quot; -AppLaunch=&quot;$(AppLaunch)&quot; -AppArgs=&quot;$(AppArgs)&quot; -FileAttributeList=&quot;$(FileAttributeList)&quot; -FileIgnoreList=&quot;$(FileIgnoreList)&quot; -Label=&quot;$(Label)&quot; -Platform=&quot;$(Platform)&quot; -CommandLineFile=&quot;$(CommandLineFile)&quot;" />
			</Node>
			<Label Category="Clients" Name="Publish To Store" Requires="$(UploadNodeName)" />
		</Agent>
	
		<!-- Just upload? -->
		<!-- TODO, should we just move these inside the agent? -->
		<Aggregate Name="BuildAndTestWithUpload $(ProjectName)" Requires="BuildAndTest $(ProjectName);$(UploadNodeName)" />
		<Label Category="Upload" Name="Upload $(UploadTargetPlatform)" Requires="$(UploadNodeName)" />
	
		<Property Name="BuildAndTestExtendedRequirements" Value="$(BuildAndTestExtendedRequirements);$(UploadNodeName)" If="'$(UploadNodeName)' != ''"/>
	</Do>
	
	<!-- =============================================================================== -->
	<!-- =============================================================================== -->
	
	<!-- Finally this defines the actual aggregated build command that will run all the requirements. -->
	<Aggregate Name="BuildAndTestExtended $(ProjectName)" Requires="$(BuildAndTestExtendedRequirements)" />

	<!-- =============================================================================== -->
	<!-- PGO BUILDS -->
	<!-- =============================================================================== -->

	<Include Script="$(RootDir)/Engine/Build/Graph/Tasks/PGOProfileProject.xml" />

	<!-- Create simple PGO nodes for all supported platforms -->
	<!--                                                                                -->
	<!--    Example: generate PGO training data for Win64 & check it in to Perforce     -->
	<!--        RunUAT BuildGraph -script="Samples\Games\Lyra\Build\LyraTests.xml" -target="Lyra PGO Profile Replay Win64" -set:TargetConfigurations=Shipping -set:WithWin64=true -set:PGOAutoSubmitResults=true -->
	<!--                                                                                    -->
	<!--    Example: generate PGO optimization data, then build a PGO optimized Win64 build -->
	<!--        RunUAT BuildGraph -script="Samples\Games\Lyra\Build\LyraTests.xml" -target="Lyra PGO Optimize Win64" -set:TargetConfigurations=Shipping -set:WithWin64=true -->
	<!--                                                                 -->
	<!-- Note: PGO is only supported on Test and Shipping configurations -->
	<ForEach Name="Platform" Values="$(AllPGOPlatforms)" If="ContainsItem('$(TargetConfigurations)','Test','+') or ContainsItem('$(TargetConfigurations)','Shipping','+')">
	
		<!-- Set the folder for the local build. Based on StagedPlatformFolder from BuildAndTestProject.xml  -->
		<Property Name="StagedPlatformFolder" Value="$(Platform)"/>
		<Property Name="StagedPlatformFolder" Value="Windows" If="'$(Platform)'=='Win64'"/>
		<Property Name="StagedPlatformFolder" Value="$(StagedPlatformFolder)_ETC2" If="'$(Platform)' == 'Android'"/>
		<Property Name="StagedPlatformFolder" Value="$(StagedPlatformFolder)Client" If="'$(TargetType)' == 'Client'" />
		
		<!-- Declare a PGO Profiling node that is dependent on a staged build (as defined in BuildAndTestProject.xml). This will also check in updated PGO training data if $(PGOAutoSubmitResults) is true. -->
		<!-- e.g. "Lyra PGO Profile Replay Win64" -->
		<!-- Note that depending on your project and build farm needs this may not be the most efficient approach. Instead of depending on a staged build (which causes it to be recooked if necessary), you may wish to point to a previously-archived build from the same CL -->
		<Expand Name="BasicReplayPGOProfile"

			Platform="$(Platform)"

			Configuration="$(TargetConfigurations)"

			LocalReplay="$(ProjectPath)/Build/Replays/PGO.replay"

			LocalStagingDir="$(ProjectPath)/LocalBuilds/PGO/$(StagedPlatformFolder)"

			Build="$(ProjectPath)/Saved/StagedBuilds/$(StagedPlatformFolder)"

			BuildRequires="$(PreNodeName)Stage $(Platform)"

			CompileArgs="$(GenericCompileArguments) $(ExtraTargetCompileArguments)"

			/>

		<!-- Declare a PGO Optimization node which regenerates the PGO training data first. -->
		<!-- e.g. "Lyra PGO Optimize Win64" -->
		<!-- Note that depending on your project and build farm needs this may not be the most efficient approach. PGO Profiling does not have to occur as frequently as PGO Optimization -->
		<Property Name="HostAgentType" Value="Win64" />
		<Property Name="HostAgentType" Value="Mac" If="'$(Platform)' == 'Mac' or '$(Platform)' == 'IOS' or '$(Platform)' == 'tvOS'"/>
		<Property Name="HostAgentType" Value="Linux" If="'$(Platform)' == 'Linux'"/>
		<Agent Name="PGO Optimize Agent $(Platform)" Type="$(HostAgentType)">
			<Node Name="$(ProjectName) PGO Optimize $(Platform)" Requires="$(PreNodeName)PGO Profile Replay $(Platform)">
				<ForEach Name="Configuration" Values="$(TargetConfigurations)" Separator="+">
					<Compile Target="$(TargetName)" Platform="$(Platform)" Configuration="$(Configuration)" Arguments="$(PGOOptimizeCompileArgs$(Platform)) -BuildVersion=&quot;$(BuildVersion)&quot; $(GenericCompileArguments) $(ExtraTargetCompileArguments)" Tag="#PGO Optimized Binaries $(Platform)"/>
				</ForEach>
			</Node>
		</Agent>
	</ForEach>
</BuildGraph>