Files
UnrealEngineUWP/Engine/Source/Programs/UnrealBuildTool/Modes/WriteDocumentationMode.cs
Ben Marsh a22b952aa9 Copying //UE4/Dev-Build to Dev-Main (//UE4/Dev-Main)
#rb none
#rnx

[CL 4718806 by Ben Marsh in Main branch]
2019-01-14 12:11:24 -05:00

67 lines
1.6 KiB
C#

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tools.DotNETCommon;
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;
}
}
}