Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Modes/WriteDocumentationMode.cs
jonathan adamczewski 223a11ee71 UnrealBuildTool
Adding "using UnrealBuildBase" to some files (submitted separately to make subsequent CLs smaller)

#jira none
#trivial

#ROBOMERGE-SOURCE: CL 16657799 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v833-16641396)

[CL 16657806 by jonathan adamczewski in ue5-release-engine-test branch]
2021-06-14 09:25:41 -04:00

68 lines
1.6 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EpicGames.Core;
using UnrealBuildBase;
namespace UnrealBuildTool
{
/// <summary>
/// Generates documentation from reflection data
/// </summary>
[ToolMode("WriteDocumentation", ToolModeOptions.None)]
class WriteDocumentationMode : ToolMode
{
/// <summary>
/// Enum for the type of documentation to generate
/// </summary>
enum DocumentationType
{
BuildConfiguration,
ModuleRules,
TargetRules,
}
/// <summary>
/// Type of documentation to generate
/// </summary>
[CommandLine(Required = true)]
DocumentationType Type = DocumentationType.BuildConfiguration;
/// <summary>
/// The HTML file to write to
/// </summary>
[CommandLine(Required = true)]
FileReference OutputFile = null!;
/// <summary>
/// Entry point for this command
/// </summary>
/// <returns></returns>
public override int Execute(CommandLineArguments Arguments)
{
Arguments.ApplyTo(this);
Arguments.CheckAllArgumentsUsed();
switch(Type)
{
case DocumentationType.BuildConfiguration:
XmlConfig.WriteDocumentation(OutputFile);
break;
case DocumentationType.ModuleRules:
RulesDocumentation.WriteDocumentation(typeof(ModuleRules), OutputFile);
break;
case DocumentationType.TargetRules:
RulesDocumentation.WriteDocumentation(typeof(TargetRules), OutputFile);
break;
default:
throw new BuildException("Invalid documentation type: {0}", Type);
}
return 0;
}
}
}