228 lines
16 KiB
XML
228 lines
16 KiB
XML
<?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" >
|
|
|
|
<!--
|
|
This script shows how to compile the tools and editor binaries required for artists to work with the engine, copy them to a staging directory for distribution, and optionally
|
|
submit them to Perforce.
|
|
|
|
If the -buildmachine option is specified on the command line, the build changelist will be updated in the engine version files (Engine/Source/Runtime/Launch/Resources/Version.h,
|
|
Engine/Build/Build.version, and Engine/Source/Programs/DotNETCommon/MetaData.cs). This will allow assets to be versioned correctly, preventing data loss if they are opened
|
|
in an older editor version.
|
|
|
|
Example usage to copy to staging directory:
|
|
|
|
RunUAT.bat BuildGraph -Script=Engine/Build/Graph/Examples/BuildEditorAndTools.xml -Target="Copy To Staging Directory" -P4
|
|
|
|
Example usage to submit to Perforce:
|
|
|
|
RunUAT.bat BuildGraph -Script=Engine/Build/Graph/Examples/BuildEditorAndTools.xml -Target="Submit To Perforce" -P4 -Submit
|
|
|
|
Example usage to submit a zip file containing binaries to Perforce, for use by UnrealGameSync:
|
|
|
|
RunUAT.bat BuildGraph -Script=Engine/Build/Graph/Examples/BuildEditorAndTools.xml -Target="Submit To Perforce For UGS" -P4 -Submit
|
|
|
|
Other options:
|
|
-set:EditorTarget=<TargetName> Specifies the editor target to be built (defaults to UnrealEditor)
|
|
-set:UProjectPath=<ProjectPath> Specifies the uproject path to pass as -Project in the compile args (defaults to none)
|
|
-set:EditorCompileArgs=<Args> Specifies the arguments to pass to Editor Compile (defaults to none)
|
|
-set:ToolCompileArgs=<Args> Specifies the arguments to pass to Tools Compile (defaults to none)
|
|
-set:GameTargets=<TargetName> Specifies the game targets to be built (defaults to none)
|
|
-set:AdditionalTools=<A>;<B>;<C>.. Specifies the additional tool targets to be built (defaults to none)
|
|
-set:TargetPlatforms=<A>;<B>;<C>... Specifies the target platforms to build the game for (defaults to Win64)
|
|
-set:OutputDir=<Path> Specifies the output directory for the compiled binaries
|
|
-set:Licensee=true/false Whether to mark the changelist number as being from a licensee Perforce server (this prevents conflicts with Epic CL's being a higher number)
|
|
-set:Versioned=true/false Whether to embed version information in the compiled binaries. This is true by default for build machines.
|
|
-set:ArchiveStream=<Path> Stream that will contain zip file of the compiled binaries, for use by UnrealGameSync.
|
|
-set:ArchiveName=<ArchiveName> Names of archive to generate instead of using the GameTarget, when the GameTarget may be UnrealEditor and result in a clash.
|
|
-set:ForceSubmit=true/false Whether to force submit to happen even if another change has been submitted (resolves in favor of local files)
|
|
-set:PreferredAgent=<AgentName> Specifies the agent to use for job, defaults to CompileWin64
|
|
-->
|
|
|
|
<Option Name="EditorTarget" Restrict="[^ ]+" DefaultValue="UnrealEditor" Description="Name of the editor target to be built"/>
|
|
<Option Name="UProjectPath" Restrict="[^ ]*" DefaultValue="" Description="Optional Uproject path to include in the arguments"/>
|
|
<Option Name="EditorCompileArgs" DefaultValue="" Description="Arguments to be used for EditorTarget Compile"/>
|
|
<Option Name="ToolCompileArgs" DefaultValue="" Description="Arguments to be used for Tool Compile"/>
|
|
<Option Name="GameTargets" Restrict="[^ ]*" DefaultValue="" Description="Names of game targets to build separated by semicolons, eg. UnrealClient;UnrealServer"/>
|
|
<Option Name="AdditionalTools" Restrict="[^ ]*" DefaultValue="" Description="Tool Compiles to build seperated by semicolons, eg. UnrealMultiUserServer;BuildPatchTool"/>
|
|
<Option Name="AdditionalEditors" Restrict="[^ ]*" DefaultValue="" Description="Editor Compiles to build seperated by semicolons"/>
|
|
<Option Name="TargetPlatforms" Restrict="[^ ]*" DefaultValue="Win64" Description="List of the target platforms to build for, separated by semicolons, eg. Win64;Android"/>
|
|
<Option Name="OutputDir" DefaultValue="$(RootDir)\LocalBuilds\$(EditorTarget)Binaries" Description ="Output directory for compiled binaries"/>
|
|
<Option Name="Licensee" Restrict="true|false" DefaultValue="true" Description="Whether to treat the changelist number as being from a licensee Perforce server"/>
|
|
<Option Name="Versioned" Restrict="true|false" DefaultValue="$(IsBuildMachine)" Description="Whether to embed changelist number into binaries"/>
|
|
<Option Name="Promoted" Restrict="true|false" DefaultValue="true" Description="Whether to set the promoted flag in version files, allowing the editor to run without UBT."/>
|
|
<Option Name="ArchiveStream" Restrict="(?://.*)?" DefaultValue="" Description="Stream path that will contain zip file of the compiled binaries, for use by UnrealGameSync"/>
|
|
<Option Name="ForceSubmit" Restrict="true|false" DefaultValue="false" Description="Forces the submit to happen even if another change has been submitted (resolves in favor of local files)"/>
|
|
<Option Name="PreferredAgent" DefaultValue="CompileWin64;Win64" Description ="Agent type to use for job"/>
|
|
<Option Name="ArchiveName" Restrict="[^ ]*" DefaultValue="$(EditorTarget)" Description="Names of archive to generate instead of using the GameTarget, when the GameTarget may be UnrealEditor and result in a clash"/>
|
|
<Option Name="SymbolStorePath" DefaultValue="" Description ="Output directory for symbol storage"/>
|
|
<Option Name="PublishCloudArtifacts" DefaultValue="false" Restrict="true|false" Description="Enable to publish cloud artifacts" />
|
|
|
|
<Property Name="ArchiveDir" Value="$(RootDir)\LocalBuilds\ArchiveForUGS"/>
|
|
<Property Name="ArchiveStagingDir" Value="$(ArchiveDir)\Staging"/>
|
|
<Property Name="ArchiveStagingRelativeDir" Value="LocalBuilds\ArchiveForUGS\Staging"/>
|
|
|
|
<EnvVar Name="UE_HORDE_JOBID"/>
|
|
|
|
<Property Name="IsHordeEnv" Value="false"/>
|
|
<Property Name="IsHordeEnv" Value="true" If="'$(UE_HORDE_JOBID)' != ''"/>
|
|
<Option Name="Horde" DefaultValue="$(IsBuildMachine) And $(IsHordeEnv)" Description="Whether the build is running under Horde"/>
|
|
|
|
<Property Name="PerforceSubmitNodeName" Value="Submit To Perforce For UGS" />
|
|
<Property Name="CloudSubmitNodeName" Value="Submit To Cloud Storage For UGS" />
|
|
<Property Name="HordeSubmitNodeName" Value="Submit To Horde Storage For UGS" />
|
|
|
|
<Property Name="GeneratedSubmitNodes" Value="" />
|
|
<Property Name="GeneratedSubmitNodes" Value="$(GeneratedSubmitNodes);$(HordeSubmitNodeName)" If="$(Horde)"/>
|
|
<Property Name="GeneratedSubmitNodes" Value="$(GeneratedSubmitNodes);$(CloudSubmitNodeName)" If="$(PublishCloudArtifacts)"/>
|
|
<Property Name="GeneratedSubmitNodes" Value="$(GeneratedSubmitNodes);$(PerforceSubmitNodeName)" If="'$(ArchiveStream)' != ''"/>
|
|
|
|
<EnvVar Name="COMPUTERNAME"/>
|
|
<EnvVar Name="P4CLIENT"/>
|
|
|
|
<Agent Name="Default Agent" Type="$(PreferredAgent)">
|
|
|
|
<!-- Update the engine version files -->
|
|
<Node Name="Update Version Files">
|
|
<SetVersion Change="$(Change)" CompatibleChange="$(CodeChange)" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="$(Versioned)"/>
|
|
<SetVersion Change="0" Branch="$(EscapedBranch)" Licensee="$(Licensee)" If="!$(Versioned) and $(Promoted)"/>
|
|
</Node>
|
|
|
|
<!-- Compile the tool executables -->
|
|
<Node Name="Compile Tools Win64" Requires="Update Version Files" Produces="#ToolBinaries">
|
|
<Compile Target="ShaderCompileWorker" Platform="Win64" Configuration="Development" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/>
|
|
<Compile Target="UnrealLightmass" Platform="Win64" Configuration="Development" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/>
|
|
<Compile Target="InterchangeWorker" Platform="Win64" Configuration="Development" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/>
|
|
<Compile Target="UnrealPak" Configuration="Development" Platform="Win64" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/>
|
|
<ForEach Name="AdditonalTool" Values="$(AdditionalTools)">
|
|
<Compile Target="$(AdditonalTool)" Platform="Win64" Configuration="Development" Tag="#ToolBinaries" Arguments="$(ToolCompileArgs)"/>
|
|
</ForEach>
|
|
|
|
<!--
|
|
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 $(EditorTarget) Win64" Produces="#EditorBinaries;#TargetInfo">
|
|
<Compile Target="$(EditorTarget)" Platform="Win64" Configuration="Development" Project="$(UProjectPath)" Tag="#EditorBinaries" Arguments="$(EditorCompileArgs)"/>
|
|
<QueryTargets ProjectFile="$(UProjectPath)" Tag="#TargetInfo"/>
|
|
<ForEach Name="AdditonalEditor" Values="$(AdditionalEditors)">
|
|
<Compile Target="$(AdditonalEditor)" Platform="Win64" Configuration="Development" Tag="#EditorBinaries" Arguments="$(EditorCompileArgs)"/>
|
|
</ForEach>
|
|
</Node>
|
|
|
|
<!-- Compile the game targets -->
|
|
<Property Name="GameBinaries" Value=""/>
|
|
<ForEach Name="GameTarget" Values="$(GameTargets)">
|
|
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
|
|
<Node Name="Compile $(GameTarget) $(TargetPlatform)" Requires="Compile Tools Win64" Produces="#GameBinaries_$(GameTarget)_$(TargetPlatform)">
|
|
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)" Configuration="Development" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
|
|
<Compile Target="$(GameTarget)" Platform="$(TargetPlatform)" Configuration="Shipping" Tag="#GameBinaries_$(GameTarget)_$(TargetPlatform)"/>
|
|
</Node>
|
|
<Property Name="GameBinaries" Value="$(GameBinaries)#GameBinaries_$(GameTarget)_$(TargetPlatform);"/>
|
|
</ForEach>
|
|
</ForEach>
|
|
|
|
<!-- Copy all the files to the output directory -->
|
|
<Node Name="Tag Output Files" Requires="#ToolBinaries;#EditorBinaries;#TargetInfo;$(GameBinaries)" Produces="#OutputFiles">
|
|
<Tag Files="#ToolBinaries;#EditorBinaries;$(GameBinaries)" Except=".../Intermediate/..." With="#OutputFiles"/>
|
|
<Tag Files="#TargetInfo" 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>
|
|
|
|
<!-- Tag PDBs with source information and write them to a symbol store. Only called if SymbolStorage option supplies a path -->
|
|
<Node Name="Store Symbols" Requires="#OutputFiles">
|
|
<!-- Embed source info into the PDB files. Should be done from this machine to ensure that paths are correct. -->
|
|
<Log Message="Embedding source file information into PDB files..." />
|
|
<Tag Files="Engine/Source/...;Engine/Plugins/..." Filter="*.c;*.h;*.cpp;*.hpp;*.inl" Except="Engine/Source/ThirdParty/..." With="#SourceFiles"/>
|
|
<SrcSrv BinaryFiles="#BinaryFiles" SourceFiles="#SourceFiles" Branch="$(Branch)" Change="$(CodeChange)"/>
|
|
<Log Message="Writing symbols to $(SymbolStorePath)"/>
|
|
<SymStore Platform="Win64" Files="#OutputFiles" StoreDir="$(SymbolStorePath)" Product="UGSEditor" BuildVersion="$(CodeChange)"/>
|
|
</Node>
|
|
|
|
<!-- Dependencies required for submitting binaries -->
|
|
<Property Name="SubmissionDependencies" Value="#OutputFiles" />
|
|
<Property Name="SubmissionDependencies" Value="$(SubmissionDependencies); Store Symbols" If="'$(SymbolStorePath)' != ''" />
|
|
|
|
<!-- Submit the build products to Perforce. -->
|
|
<Node Name="Submit To Perforce" Requires="$(SubmissionDependencies)">
|
|
<Submit Description="[CL $(CodeChange)] Updated binaries" Files="#OutputFiles" FileType="binary+FS32"/>
|
|
</Node>
|
|
|
|
<!-- Prepare a build for UGS -->
|
|
<Node Name="Stage for UGS" Requires="$(SubmissionDependencies)" Produces="#PublishBinaries">
|
|
<!-- Clear out the staging directory -->
|
|
<Delete Files="$(ArchiveDir)\..."/>
|
|
|
|
<!-- Tag AutomationTool build folder recursively -->
|
|
<Tag Files="Engine/Binaries/DotNET/AutomationTool/..." With="#ArchiveBinaries"/>
|
|
|
|
<!-- Write a text file marker indicating that we're using precompiled binaries -->
|
|
<Spawn Exe="cmd.exe" Arguments="/C echo. >"$(RootDir)/Engine/Build/PrecompiledBinaries.txt""/>
|
|
<Tag Files="$(RootDir)/Engine/Build/PrecompiledBinaries.txt" With="#ArchiveFiles"/>
|
|
|
|
<!-- 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"/>
|
|
|
|
<!-- List all the files being archived -->
|
|
<Log Message="Archive binaries:" Files="#ArchiveBinaries"/>
|
|
<Log Message="Archive symbols:" Files="#ArchiveSymbols"/>
|
|
|
|
<!-- Stage all the files to be archived -->
|
|
<Copy Files="#ArchiveBinaries" From="$(RootDir)" To="$(ArchiveStagingDir)"/>
|
|
<Strip Files="#ArchiveSymbols" BaseDir="$(RootDir)" OutputDir="$(ArchiveStagingDir)" Platform="Win64"/>
|
|
<Tag Files="$(ArchiveStagingDir)/..." With="#PublishBinaries"/>
|
|
</Node>
|
|
|
|
<!-- Create a zip file and submit it to Perforce -->
|
|
<Node Name="$(PerforceSubmitNodeName)" Requires="Stage for UGS">
|
|
<Property Name="ArchivePerforceDir" Value="$(RootDir)\LocalBuilds\ArchiveForUGS-Perforce"/>
|
|
<Property Name="ArchiveFile" Value="$(ArchivePerforceDir)\$(EscapedBranch)-$(ArchiveName).zip"/>
|
|
<Zip FromDir="$(ArchiveStagingDir)" ZipFile="$(ArchiveFile)"/>
|
|
<Warning Message="The 'ArchiveStream' argument is not set. Binaries will not be submitted." If="'$(ArchiveStream)' == ''"/>
|
|
<Property Name="SubmitClient" Value="$(COMPUTERNAME)_ArchiveForUGS"/>
|
|
<Property Name="SubmitClient" Value="$(P4CLIENT)_ArchiveForUGS" If="'$(P4CLIENT)' != ''"/>
|
|
<Submit Description="[CL $(CodeChange)] Updated binaries" Files="$(ArchiveFile)" FileType="binary+FS32" Workspace="$(SubmitClient)" Stream="$(ArchiveStream)" RootDir="$(ArchivePerforceDir)" Force="$(ForceSubmit)" If="'$(ArchiveStream)' != ''"/>
|
|
</Node>
|
|
|
|
<Node Name="$(CloudSubmitNodeName)" Requires="Stage for UGS">
|
|
<Error Message="UProjectPath is a required option when submitting to Cloud Storage" If="'$(UProjectPath)' == ''" />
|
|
<Property Name="UgsProjectKey" Value="ugs-project=$(Branch)/$(UProjectPath)" />
|
|
|
|
<CreateCloudArtifact Name="editor" Type="ugs-pcb" BaseDir="$(ArchiveStagingRelativeDir)" Metadata="$(UgsProjectKey);ArchiveType=Editor" Project="$(UProjectPath)" Platform="Windows" Files="#PublishBinaries"/>
|
|
</Node>
|
|
|
|
<Node Name="$(HordeSubmitNodeName)" Requires="Stage for UGS">
|
|
<!-- Upload binaries to Horde -->
|
|
<Property Name="UgsProjectKey" Value=""/>
|
|
<Property Name="UgsProjectKey" Value="ugs-project=$(Branch)/$(UProjectPath)" If="'$(Branch)' != '' and '$(UProjectPath)' != ''"/>
|
|
<Property Name="UgsProjectKey" Value="ugs-project=$(Branch)" If="'$(Branch)' != '' and '$(UgsProjectKey)' == ''"/>
|
|
<CreateArtifact Name="editor" Description="Editor PCBs" Type="ugs-pcb" BaseDir="$(ArchiveStagingRelativeDir)" Keys="$(UgsProjectKey)" Metadata="ArchiveType=Editor" Files="#PublishBinaries"/>
|
|
</Node>
|
|
</Agent>
|
|
|
|
<Aggregate Name="Submit PCBs" Requires="$(GeneratedSubmitNodes)"/>
|
|
|
|
<Label Category="Editors" Name="Win64" Requires="Compile $(EditorTarget) Win64" UgsBadge="Editor"/>
|
|
|
|
<ForEach Name="TargetPlatform" Values="$(TargetPlatforms)">
|
|
<Property Name="GameTargetNodes" Value=""/>
|
|
<ForEach Name="GameTarget" Values="$(GameTargets)">
|
|
<Property Name="GameTargetNodes" Value="$(GameTargetNodes)Compile $(GameTarget) $(TargetPlatform);"/>
|
|
</ForEach>
|
|
<Do If="'$(GameTargetNodes)' != ''">
|
|
<Label Category="Target Platforms" Name="$(TargetPlatform)" Requires="$(GameTargetNodes)" UgsBadge="$(TargetPlatform)"/>
|
|
</Do>
|
|
</ForEach>
|
|
|
|
</BuildGraph>
|