Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/BuildDocumentation.Automation.cs

161 lines
4.9 KiB
C#
Raw Normal View History

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Threading;
using System.Reflection;
using AutomationTool;
using UnrealBuildTool;
class ToolsForDocumentationNode : GUBP.HostPlatformNode
{
public ToolsForDocumentationNode(GUBP.GUBPBranchConfig InBranchConfig, UnrealTargetPlatform InHostPlatform)
: base(InHostPlatform)
{
AgentSharingGroup = "Documentation" + StaticGetHostPlatformSuffix(InHostPlatform);
}
public static string StaticGetFullName(UnrealTargetPlatform InHostPlatform)
{
return "ToolsForDocumentation" + StaticGetHostPlatformSuffix(InHostPlatform);
}
public override string GetFullName()
{
return StaticGetFullName(HostPlatform);
}
public override float Priority()
{
return -100000.0f;
}
public override int CISFrequencyQuantumShift(GUBP.GUBPBranchConfig BranchConfig)
{
return base.CISFrequencyQuantumShift(BranchConfig) + 6;
}
public override void DoBuild(GUBP bp)
{
CommandUtils.BuildSolution(CommandUtils.CmdEnv, "Engine/Source/Programs/UnrealDocTool/APIDocTool/APIDocTool.sln", "Development", "x64");
CommandUtils.BuildSolution(CommandUtils.CmdEnv, "Engine/Source/Programs/UnrealDocTool/UnrealDocTool/UnrealDocTool.sln", "Development", "Any CPU");
BuildProducts = new List<string>();
SaveRecordOfSuccessAndAddToBuildProducts();
}
}
Copying //UE4/Dev-Build to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2828332 on 2016/01/14 by Matthew.Griffin Ensure that warnings from Dynamic Compilation of build.cs files are propagated up to user when compiling in Visual Studio etc. Change 2828335 on 2016/01/14 by Matthew.Griffin Renaming AddThirdParty... functions to AddEngineThirdParty... so it's clear we're talking about third party libraries within the engine directory. This removes another couple of RunningRocket checks and uses the IsMonolithic property now. Change 2831365 on 2016/01/16 by Ben.Marsh Add a UAT command to remove any temp storage directories older than a specified length of time, and disable the GUBP node to do so when running with -NewEC. Better to set this up as a separate scheduled task for each temp storage folder we have, rather than run it as part of GUBP builds above a certain size. Change 2832166 on 2016/01/18 by Ben.Marsh Make INI file parsing much more tolerant to errors, because it prevents the build system from starting up. Now outputs warnings rather than throwing exceptions. Change 2835725 on 2016/01/20 by Matthew.Griffin Removed more uses of RunningRocket functions Switch Linux staging check to see if required files exist until switched to using receipts Always stage CrashReporter for Linux Mac and Linux will not use Compile Lean And Mean when generating project files Allow normal DynamicCompilation check to occur in binary builds Allow XMPP dependency on WebRTC now that it's publically distributed Change 2835864 on 2016/01/20 by Matthew.Griffin Made sure -rocket is passed when generating project files as this has to work from UnrealVersionSelector with every version of the Engine we've released. Also tidied up some arguments that are set in UVS and never used. Change 2839932 on 2016/01/22 by Matthew.Griffin Removed last uses of RunningRocket from UnrealBuildTool Changed Mac Build.sh so that it doesn't try to build UBT so that it can be used in installed builds the same way as windows. Combined code doing very similar things for single games and rocket projects. Removed check on whether to add client and server targets in Rocket as we don't distribute the .target.cs files. Removed RunningRocket function and the code checking for -rocket on the command line Change 2846971 on 2016/01/28 by Matthew.Griffin Replaced RunningRocket with IsEngineInstalled for all Engine programs that won't need to be built. Change 2853879 on 2016/02/03 by Matthew.Griffin Added UnrealLightmass to list of programs to build when Build Solution is used and Editor configuration is selected #jira UE-25666 #lockdown Nick.Penwarden [CL 2854567 by Ben Marsh in Main branch]
2016-02-03 15:40:40 -05:00
class DocumentationNode : GUBP.HostPlatformNode
{
Copying //UE4/Dev-Build to //UE4/Main ========================== MAJOR FEATURES + CHANGES ========================== Change 2828332 on 2016/01/14 by Matthew.Griffin Ensure that warnings from Dynamic Compilation of build.cs files are propagated up to user when compiling in Visual Studio etc. Change 2828335 on 2016/01/14 by Matthew.Griffin Renaming AddThirdParty... functions to AddEngineThirdParty... so it's clear we're talking about third party libraries within the engine directory. This removes another couple of RunningRocket checks and uses the IsMonolithic property now. Change 2831365 on 2016/01/16 by Ben.Marsh Add a UAT command to remove any temp storage directories older than a specified length of time, and disable the GUBP node to do so when running with -NewEC. Better to set this up as a separate scheduled task for each temp storage folder we have, rather than run it as part of GUBP builds above a certain size. Change 2832166 on 2016/01/18 by Ben.Marsh Make INI file parsing much more tolerant to errors, because it prevents the build system from starting up. Now outputs warnings rather than throwing exceptions. Change 2835725 on 2016/01/20 by Matthew.Griffin Removed more uses of RunningRocket functions Switch Linux staging check to see if required files exist until switched to using receipts Always stage CrashReporter for Linux Mac and Linux will not use Compile Lean And Mean when generating project files Allow normal DynamicCompilation check to occur in binary builds Allow XMPP dependency on WebRTC now that it's publically distributed Change 2835864 on 2016/01/20 by Matthew.Griffin Made sure -rocket is passed when generating project files as this has to work from UnrealVersionSelector with every version of the Engine we've released. Also tidied up some arguments that are set in UVS and never used. Change 2839932 on 2016/01/22 by Matthew.Griffin Removed last uses of RunningRocket from UnrealBuildTool Changed Mac Build.sh so that it doesn't try to build UBT so that it can be used in installed builds the same way as windows. Combined code doing very similar things for single games and rocket projects. Removed check on whether to add client and server targets in Rocket as we don't distribute the .target.cs files. Removed RunningRocket function and the code checking for -rocket on the command line Change 2846971 on 2016/01/28 by Matthew.Griffin Replaced RunningRocket with IsEngineInstalled for all Engine programs that won't need to be built. Change 2853879 on 2016/02/03 by Matthew.Griffin Added UnrealLightmass to list of programs to build when Build Solution is used and Editor configuration is selected #jira UE-25666 #lockdown Nick.Penwarden [CL 2854567 by Ben Marsh in Main branch]
2016-02-03 15:40:40 -05:00
public DocumentationNode(UnrealTargetPlatform InHostPlatform) : base(InHostPlatform)
{
AgentSharingGroup = "Documentation" + GUBP.HostPlatformNode.StaticGetHostPlatformSuffix(InHostPlatform);
AddDependency(ToolsForDocumentationNode.StaticGetFullName(InHostPlatform));
}
public override int CISFrequencyQuantumShift(GUBP.GUBPBranchConfig BranchConfig)
{
return base.CISFrequencyQuantumShift(BranchConfig) + 3;
}
protected void ExecuteApiDocTool(string Arguments, string LogName)
{
string ApiDocToolPath = Path.Combine(CommandUtils.CmdEnv.LocalRoot, "Engine/Source/Programs/UnrealDocTool/APIDocTool/APIDocTool/bin/x64/Release/APIDocTool.exe");
string ApiToolCommandLine = Arguments + " -enginedir=\"" + Path.Combine(CommandUtils.CmdEnv.LocalRoot, "Engine") + "\"" + (CommandUtils.IsBuildMachine? " -buildmachine" : "");
CommandUtils.RunAndLog(CommandUtils.CmdEnv, ApiDocToolPath, ApiToolCommandLine, LogName);
}
public override bool NotifyOnWarnings()
{
return false;
}
public static void SubmitOutputs(string Description, params string[] FileSpecs)
{
if (CommandUtils.P4Enabled)
{
int Changelist = CommandUtils.P4.CreateChange(CommandUtils.P4Env.Client, String.Format("{0} from CL#{1}", Description, CommandUtils.P4Env.Changelist));
foreach (string FileSpec in FileSpecs)
{
CommandUtils.P4.Reconcile(Changelist, CommandUtils.CombinePaths(PathSeparator.Slash, CommandUtils.P4Env.ClientRoot, FileSpec));
}
if (!CommandUtils.P4.TryDeleteEmptyChange(Changelist))
{
if (!GlobalCommandLine.NoSubmit)
{
int SubmittedChangelist;
CommandUtils.P4.Submit(Changelist, out SubmittedChangelist, true, true);
}
}
}
}
}
class CodeDocumentationNode : DocumentationNode
{
public CodeDocumentationNode(UnrealTargetPlatform InHostPlatform)
: base(InHostPlatform)
{
}
public override void DoBuild(GUBP bp)
{
ExecuteApiDocTool("-rebuildcode", "APIDocTool-Code");
SubmitOutputs("Code documentation", "Engine/Documentation/Builds/CodeAPI-*", "Engine/Documentation/CHM/API.chm");
base.DoBuild(bp);
}
public override string GetFullName()
{
return StaticGetFullName();
}
public static string StaticGetFullName()
{
return "CodeDocumentation";
}
}
class BlueprintDocumentationNode : DocumentationNode
{
public BlueprintDocumentationNode(UnrealTargetPlatform InHostPlatform)
: base(InHostPlatform)
{
AddDependency(GUBP.RootEditorNode.StaticGetFullName(InHostPlatform));
AddDependency(GUBP.ToolsNode.StaticGetFullName(InHostPlatform));
}
public override void DoBuild(GUBP bp)
{
ExecuteApiDocTool("-rebuildblueprint", "APIDocTool-Blueprint");
SubmitOutputs("Blueprint documentation", "Engine/Documentation/Builds/BlueprintAPI-*", "Engine/Documentation/CHM/BlueprintAPI.chm");
base.DoBuild(bp);
}
public override string GetFullName()
{
return StaticGetFullName();
}
public static string StaticGetFullName()
{
return "BlueprintDocumentation";
}
}
public class DocumentationNodeAdder : GUBP.GUBPNodeAdder
{
public override void AddNodes(GUBP bp, GUBP.GUBPBranchConfig BranchConfig, UnrealTargetPlatform InHostPlatform, List<UnrealTargetPlatform> InActivePlatforms)
{
if(InHostPlatform == UnrealTargetPlatform.Win64 && !BranchConfig.BranchOptions.bNoDocumentation)
{
BranchConfig.AddNode(new ToolsForDocumentationNode(BranchConfig, InHostPlatform));
BranchConfig.AddNode(new CodeDocumentationNode(InHostPlatform));
BranchConfig.AddNode(new BlueprintDocumentationNode(InHostPlatform));
}
}
}