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;
16
17namespace Nuke.Unreal;
18
19/// <summary>
20/// Target for packaging the current project we're working on
21/// </summary>
22public interface IPackageTargets : IUnrealBuild
23{
24 /// <summary>
25 /// UAT arguments to be applied every time UAT is called for Packaging.
26 /// Explicitly implement this function in your main build class if your project needs extra
27 /// intricacies for Packaging.
28 /// For example specifying maps explicitly.
29 /// </summary>
31
32 /// <summary>
33 /// Same as running Package Project from Editor
34 /// <code>
35 /// \--Config
36 /// \--Platform
37 /// \--AndroidTextureMode
38 /// \-->ubt (args.)
39 /// \-->uat (args.)
40 /// </code>
41 /// </summary>
42 Target Package => _ => _
43 .Description(
44 """
45 |
46 | Same as running Package Project from Editor
47 |
48 | --Config
49 | --Platform
50 | --AndroidTextureMode
51 | -->ubt (args.)
52 | -->uat (args.)
53
54 """
55 )
56 .DependsOn(BuildEditor, SetupPlatformSdk)
58 .Executes(() =>
59 {
60 var appLocalDir = UnrealEnginePath / "Engine" / "Binaries" / "ThirdParty" / "AppLocalDependencies";
61 Config.ForEach(config =>
62 {
63 Unreal.AutomationTool(this, _ => _
64 .BuildCookRun(_ => _
66 .Target(ProjectName)
67 .Clientconfig(Config)
68 .Manifests()
69 .AppLocalDirectory(appLocalDir)
70 .If(ForDistribution(), _ => _
71 .Distribution()
72 )
73 )
74 .ScriptsForProject(ProjectPath)
75 .Targetplatform(Platform)
76 .Build()
77 .Stage()
78 .Package()
79 .Archive()
80 .Archivedirectory(GetOutput())
81 .If(InvokedTargets.Contains(Cook),
82 _ => _.Skipcook(),
83 _ => _.Cook()
84 )
85 .If(!InvokedTargets.Contains(BuildEditor), _ => _
86 .NoCompileEditor()
87 )
88 .If(this.IsAndroidPlatform(), _ => _
89 .Cookflavor(AndroidTextureMode)
90 )
91 .Apply(UatGlobal)
92 .Apply(UatCook)
93 .Apply(UatPackage)
94 .AppendRaw(GetArgumentBlock("uat"))
95 )(
96 workingDirectory: UnrealEnginePath
97 );
98 });
99 });
100}
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
A collection of utilities around basic functions regarding the environment of the Engine we're workin...
Definition Unreal.cs:24
static ToolEx AutomationTool(EngineVersion ofVersion)
Prepare invocation for UAT.
Definition Unreal.cs:281
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...
Target Package
Same as running Package Project from Editor.
Base interface for build components which require an UnrealBuild main class.
AbsolutePath UnrealEnginePath
Path to the root of the associated Unreal Engine installation/source.
UatConfig UatGlobal(UatConfig _)
UAT arguments to be applied globally for all UAT invocations. Override this function in your main bui...
string ProjectName
Short name of the project.
AndroidCookFlavor[] AndroidTextureMode
IEnumerable< string > GetArgumentBlock(string name="")
Get optionally named argument block (section after -->) with contextual data substituted....
UnrealPlatform Platform
UatConfig UatCook(UatConfig _)
UAT arguments to be applied every time UAT is called for Cooking. Override this function in your main...
AbsolutePath GetOutput()
Get an output folder where the targets should store their artifacts. Override this function in your m...
bool ForDistribution()
Enforce packaging for distribution when that is set from Game ini files. Override this function in yo...
@ Project
Enable debug info for project modules.