Files
UnrealEngineUWP/Engine/Source/Programs/AutomationTool/Scripts/UE4BuildUtils.cs
Peter Sauerbrei dc1d815f84 refactored the logging system for UAT/UBT to be more like UE4
we now use an enum similar to UE4 with Fatal, Error, Warning, Display, Log, Verbose, and VeryVerbose
Log will only go to the log file unless -verbose is passed on the command line
reduced some of the output from UAT to be Log only

[CL 2631062 by Peter Sauerbrei in Main branch]
2015-07-23 14:51:46 -04:00

78 lines
2.0 KiB
C#

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutomationTool;
using UnrealBuildTool;
/// <summary>
/// Common UEBuild utilities
/// </summary>
public class UE4BuildUtils : CommandUtils
{
/// <summary>
/// Builds BuildPatchTool for the specified platform.
/// </summary>
/// <param name="Command"></param>
/// <param name="InPlatform"></param>
public static void BuildBuildPatchTool(BuildCommand Command, UnrealBuildTool.UnrealTargetPlatform InPlatform)
{
BuildProduct(Command, new UE4Build.BuildTarget()
{
ProjectName = "",
TargetName = "BuildPatchTool",
Platform = InPlatform,
Config = UnrealBuildTool.UnrealTargetConfiguration.Development,
});
}
/// <summary>
/// Builds UnrealHeaderTool for the specified platform.
/// </summary>
/// <param name="Command"></param>
/// <param name="InPlatform"></param>
public static void BuildUnrealHeaderTool(BuildCommand Command, UnrealBuildTool.UnrealTargetPlatform InPlatform)
{
BuildProduct(Command, new UE4Build.BuildTarget()
{
ProjectName = "",
TargetName = "UnrealHeaderTool",
Platform = InPlatform,
Config = UnrealBuildTool.UnrealTargetConfiguration.Development,
});
}
private static void BuildProduct(BuildCommand Command, UE4Build.BuildTarget Target)
{
if (Target == null)
{
throw new AutomationException("Target is required when calling UE4BuildUtils.BuildProduct");
}
LogConsole("Building {0}", Target.TargetName);
if (Command == null)
{
Command = new UE4BuildUtilDummyBuildCommand();
}
var UE4Build = new UE4Build(Command);
var Agenda = new UE4Build.BuildAgenda();
Agenda.Targets.Add(Target);
UE4Build.Build(Agenda, InDeleteBuildProducts: true, InUpdateVersionFiles: true);
UE4Build.CheckBuildProducts(UE4Build.BuildProductFiles);
}
class UE4BuildUtilDummyBuildCommand : BuildCommand
{
public override void ExecuteBuild()
{
// noop
}
}
}