Nuke.Unreal
Build Unreal apps in Style.
Loading...
Searching...
No Matches
IPackageTargets.cs
1
2using System;
3using System.Collections.Generic;
4using System.Linq;
5using System.IO;
6using System.IO.Compression;
7using Nuke.Common.IO;
8using Newtonsoft.Json;
9using Newtonsoft.Json.Linq;
10using Nuke.Common;
11using Nuke.Common.Utilities.Collections;
13using Nuke.Cola;
14using Nuke.Common.Utilities;
15
16using static Nuke.Common.IO.PathConstruction;
17
18namespace Nuke.Unreal
19{
20 public class PackageTargets : NukeBuild, IPackageTargets
21 {
22 public static readonly IPackageTargets Default = new PackageTargets();
23 }
24
25 /// <summary>
26 /// Target for packaging the current project we're working on
27 /// </summary>
28 public interface IPackageTargets : INukeBuild
29 {
30 T Self<T>() where T : INukeBuild => (T)(object)this;
31 T? SelfAs<T>() where T : class, INukeBuild => (object)this as T;
32
33 /// <summary>
34 /// UAT arguments to be applied every time UAT is called for Packaging.
35 /// Explicitly implement this function in your main build class if your project needs extra
36 /// intricacies for Packaging.
37 /// For example specifying maps explicitly.
38 /// </summary>
40
41 Target Package => _ => _
42 .Description("Same as running Package Project from Editor")
43 .DependsOn<UnrealBuild>(u => u.BuildEditor)
44 .After<UnrealBuild>(
45 u => u.CleanDeployment,
46 u => u.Cook,
47 u => u.Prepare,
48 u => u.Switch
49 )
50 .Executes(() =>
51 {
52 var self = Self<UnrealBuild>();
53 var androidTextureMode = SelfAs<IAndroidTargets>()?.TextureMode
54 ?? [ AndroidCookFlavor.Multi ];
55
56 var isAndroidPlatform = self.Platform == UnrealPlatform.Android;
57 var appLocalDir = self.UnrealEnginePath / "Engine" / "Binaries" / "ThirdParty" / "AppLocalDependencies";
58 self.Config.ForEach(config =>
59 {
60 Unreal.AutomationTool(self, _ => _
61 .BuildCookRun(_ => _
62 .Project(self.ProjectPath)
63 .Target(self.ProjectName)
64 .Clientconfig(self.Config)
65 .Manifests()
66 .AppLocalDirectory(appLocalDir)
67 .If(self.ForDistribution(), _ => _
68 .Distribution()
69 )
70 )
71 .ScriptsForProject(self.ProjectPath)
72 .Targetplatform(self.Platform)
73 .Build()
74 .Stage()
75 .Package()
76 .Archive()
77 .Archivedirectory(self.GetOutput())
78 .If(InvokedTargets.Contains(self.Cook),
79 _ => _.Skipcook(),
80 _ => _.Cook()
81 )
82 .If(!InvokedTargets.Contains(self.BuildEditor), _ => _
83 .NoCompileEditor()
84 )
85 .If(isAndroidPlatform, _ => _
86 .Cookflavor(androidTextureMode)
87 )
88 .Apply(self.UatGlobal)
89 .Apply(self.UatCook)
90 .Apply(UatPackage)
91 .AppendRaw(self.GetArgumentBlock("uat"))
92 )("", workingDirectory: self.UnrealEnginePath);
93 });
94 });
95 }
96}
virtual UatConfig Prereqs(params object[] values)
stage prerequisites along with the project
Unreal Automation Tool is a vast collection of scripts solving all aspects of deploying a program mad...
Definition UatConfig.cs:13
The main build class Unreal projects using Nuke.Unreal should inherit from. This class contains all b...
High level representation of common platforms supported by Unreal Engine (NDA ones excluded) and extr...
A collection of utilities around basic functions regarding the environment of the Engine we're workin...
Definition Unreal.cs:24
static Tool AutomationTool(EngineVersion ofVersion)
Prepare invocation for UAT.
Definition Unreal.cs:266
Target for packaging the current project we're working on.
UatConfig UatPackage(UatConfig _)
UAT arguments to be applied every time UAT is called for Packaging. Explicitly implement this functio...
@ Project
Enable debug info for project modules.