本文整理汇总了C#中AutomationTool.UE4Build.AddUBTFilesToBuildProducts方法的典型用法代码示例。如果您正苦于以下问题:C# UE4Build.AddUBTFilesToBuildProducts方法的具体用法?C# UE4Build.AddUBTFilesToBuildProducts怎么用?C# UE4Build.AddUBTFilesToBuildProducts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AutomationTool.UE4Build
的用法示例。
在下文中一共展示了UE4Build.AddUBTFilesToBuildProducts方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteBuild
public override void ExecuteBuild()
{
// Get the output directory
string TargetDir = ParseParamValue("TargetDir");
if(TargetDir == null)
{
throw new AutomationException("Missing -Target argument to CopyUAT");
}
// Construct a dummy UE4Build object to get a list of the UAT and UBT build products
UE4Build Build = new UE4Build(this);
Build.AddUATFilesToBuildProducts();
if(ParseParam("WithLauncher"))
{
Build.AddUATLauncherFilesToBuildProducts();
}
Build.AddUBTFilesToBuildProducts();
// Get a list of all the input files
List<string> FileNames = new List<string>(Build.BuildProductFiles);
foreach(string FileName in Build.BuildProductFiles)
{
string SymbolFileName = Path.ChangeExtension(FileName, ".pdb");
if(File.Exists(SymbolFileName))
{
FileNames.Add(SymbolFileName);
}
}
// Copy all the files over
foreach(string FileName in FileNames)
{
string TargetFileName = Utils.MakeRerootedFilePath(FileName, CommandUtils.CmdEnv.LocalRoot, TargetDir);
Directory.CreateDirectory(Path.GetDirectoryName(TargetFileName));
File.Copy(FileName, TargetFileName);
}
Log("Copied {0} files to {1}", FileNames.Count, TargetDir);
}
示例2: PostBuild
public override void PostBuild(GUBP bp, UE4Build UE4Build)
{
if (HostPlatform == UnrealTargetPlatform.Win64)
{
UE4Build.AddUATFilesToBuildProducts();
UE4Build.AddUBTFilesToBuildProducts();
}
}
示例3: PostBuild
public override void PostBuild(GUBP bp, UE4Build UE4Build)
{
UE4Build.AddUATFilesToBuildProducts();
UE4Build.AddUBTFilesToBuildProducts();
}
示例4: ExecuteBuild
public override void ExecuteBuild()
{
LogConsole("************************* BuildCommonTools");
// Get the list of platform names
string[] PlatformNames = ParseParamValue("platforms", BuildHostPlatform.Current.Platform.ToString()).Split('+');
// Parse the platforms
List<UnrealBuildTool.UnrealTargetPlatform> Platforms = new List<UnrealTargetPlatform>();
foreach(string PlatformName in PlatformNames)
{
UnrealBuildTool.UnrealTargetPlatform Platform;
if(!UnrealBuildTool.UnrealTargetPlatform.TryParse(PlatformName, true, out Platform))
{
throw new AutomationException("Unknown platform specified on command line - '{0}' - valid platforms are {1}", PlatformName, String.Join("/", Enum.GetNames(typeof(UnrealBuildTool.UnrealTargetPlatform))));
}
Platforms.Add(Platform);
}
// Add all the platforms if specified
if(ParseParam("allplatforms"))
{
foreach(UnrealTargetPlatform Platform in Enum.GetValues(typeof(UnrealTargetPlatform)))
{
if(!Platforms.Contains(Platform))
{
Platforms.Add(Platform);
}
}
}
// Get the agenda
List<string> ExtraBuildProducts = new List<string>();
UE4Build.BuildAgenda Agenda = MakeAgenda(Platforms.ToArray(), ExtraBuildProducts);
// Build everything. We don't want to touch version files for GitHub builds -- these are "programmer builds" and won't have a canonical build version
UE4Build Builder = new UE4Build(this);
Builder.Build(Agenda, InDeleteBuildProducts:true, InUpdateVersionFiles: false);
// Add UAT and UBT to the build products
Builder.AddUATFilesToBuildProducts();
Builder.AddUBTFilesToBuildProducts();
// Add all the extra build products
foreach(string ExtraBuildProduct in ExtraBuildProducts)
{
Builder.AddBuildProduct(ExtraBuildProduct);
}
// Make sure all the build products exist
UE4Build.CheckBuildProducts(Builder.BuildProductFiles);
// Write the manifest if needed
string ManifestPath = ParseParamValue("manifest");
if(ManifestPath != null)
{
SortedSet<string> Files = new SortedSet<string>();
foreach(string BuildProductFile in Builder.BuildProductFiles)
{
Files.Add(BuildProductFile);
}
File.WriteAllLines(ManifestPath, Files.ToArray());
}
}
示例5: ExecuteBuild
public override void ExecuteBuild()
{
// Parse the target list
string[] Targets = ParseParamValues("Target");
if(Targets.Length == 0)
{
throw new AutomationException("No targets specified (eg. -Target=\"UE4Editor Win64 Development\")");
}
// Parse the archive path
string ArchivePath = ParseParamValue("Archive");
if(ArchivePath != null && (!ArchivePath.StartsWith("//") || ArchivePath.Sum(x => (x == '/')? 1 : 0) < 4))
{
throw new AutomationException("Archive path is not a valid depot filename");
}
// Prepare the build agenda
UE4Build.BuildAgenda Agenda = new UE4Build.BuildAgenda();
foreach(string Target in Targets)
{
string[] Tokens = Target.Split(new char[]{ ' ' }, StringSplitOptions.RemoveEmptyEntries);
UnrealTargetPlatform Platform;
UnrealTargetConfiguration Configuration;
if(Tokens.Length < 3 || !Enum.TryParse(Tokens[1], true, out Platform) || !Enum.TryParse(Tokens[2], true, out Configuration))
{
throw new AutomationException("Invalid target '{0}' - expected <TargetName> <Platform> <Configuration>");
}
Agenda.AddTarget(Tokens[0], Platform, Configuration, InAddArgs: String.Join(" ", Tokens.Skip(3)));
}
// Build everything
UE4Build Builder = new UE4Build(this);
Builder.Build(Agenda, InUpdateVersionFiles: ArchivePath != null);
// Include the build products for UAT and UBT if required
if(ParseParam("WithUAT"))
{
Builder.AddUATFilesToBuildProducts();
}
if(ParseParam("WithUBT"))
{
Builder.AddUBTFilesToBuildProducts();
}
// Archive the build products
if(ArchivePath != null)
{
// Create an output folder
string OutputFolder = Path.Combine(CommandUtils.CmdEnv.LocalRoot, "ArchiveForUGS");
Directory.CreateDirectory(OutputFolder);
// Create a temp folder for storing stripped PDB files
string SymbolsFolder = Path.Combine(OutputFolder, "Symbols");
Directory.CreateDirectory(SymbolsFolder);
// Get the Windows toolchain
UEToolChain WindowsToolChain = UEBuildPlatform.GetBuildPlatform(UnrealTargetPlatform.Win64).CreateContext(null).CreateToolChain(CPPTargetPlatform.Win64);
// Figure out all the files for the archive
Ionic.Zip.ZipFile Zip = new Ionic.Zip.ZipFile();
Zip.UseZip64WhenSaving = Ionic.Zip.Zip64Option.Always;
foreach(string BuildProduct in Builder.BuildProductFiles)
{
if(!File.Exists(BuildProduct))
{
throw new AutomationException("Missing build product: {0}", BuildProduct);
}
if(BuildProduct.EndsWith(".pdb", StringComparison.InvariantCultureIgnoreCase))
{
string StrippedFileName = CommandUtils.MakeRerootedFilePath(BuildProduct, CommandUtils.CmdEnv.LocalRoot, SymbolsFolder);
Directory.CreateDirectory(Path.GetDirectoryName(StrippedFileName));
WindowsToolChain.StripSymbols(BuildProduct, StrippedFileName);
Zip.AddFile(StrippedFileName, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(StrippedFileName, SymbolsFolder)));
}
else
{
Zip.AddFile(BuildProduct, Path.GetDirectoryName(CommandUtils.StripBaseDirectory(BuildProduct, CommandUtils.CmdEnv.LocalRoot)));
}
}
// Create the zip file
string ZipFileName = Path.Combine(OutputFolder, "Archive.zip");
Console.WriteLine("Writing {0}...", ZipFileName);
Zip.Save(ZipFileName);
// Submit it to Perforce if required
if(CommandUtils.AllowSubmit)
{
// Delete any existing clientspec for submitting
string ClientName = Environment.MachineName + "_BuildForUGS";
// Create a brand new one
P4ClientInfo Client = new P4ClientInfo();
Client.Owner = CommandUtils.P4Env.User;
Client.Host = Environment.MachineName;
Client.Stream = ArchivePath.Substring(0, ArchivePath.IndexOf('/', ArchivePath.IndexOf('/', 2) + 1));
Client.RootPath = Path.Combine(OutputFolder, "Perforce");
Client.Name = ClientName;
Client.Options = P4ClientOption.NoAllWrite | P4ClientOption.NoClobber | P4ClientOption.NoCompress | P4ClientOption.Unlocked | P4ClientOption.NoModTime | P4ClientOption.RmDir;
//.........这里部分代码省略.........