Nuke.Unreal
Build Unreal apps in Style.
Loading...
Searching...
No Matches
IPlatformSdk.cs
1
using
System;
2
using
System.Collections.Generic;
3
using
System.Linq;
4
using
System.Threading.Tasks;
5
using
Nuke.Cola.Tooling;
6
using
Nuke.Common;
7
using
Nuke.Common.IO;
8
9
namespace
Nuke.Unreal.Platforms
;
10
11
/// <summary>
12
/// A record for providing build information for XMake/XRepo when that may be requested
13
/// </summary>
14
/// <param name="Arguments"></param>
15
/// <param name="Platform">
16
/// XMake compatible platform name. If not specified known common platforms will be inferred.
17
/// </param>
18
/// <param name="ToolSetup">
19
/// Arbitrary modification to the XRepo tool execution
20
/// </param>
21
public
record
class
PlatformSdkXMakeData
(
22
string Arguments,
23
string? Platform =
null
,
24
Func<ToolEx, ToolEx>? ToolSetup = null
25
);
26
27
/// <summary>
28
/// Base interface for implementing the automatic SDK management for a host-target platform pair.
29
/// </summary>
30
public
interface
IPlatformSdk
31
{
32
/// <summary>
33
/// The platform used for development, hosting this SDK to cross-compile target platform
34
/// </summary>
35
UnrealPlatform
Host
{
get
; }
36
37
/// <summary>
38
/// The platform targeted by given SDK
39
/// </summary>
40
UnrealPlatform
Target
{
get
; }
41
42
/// <summary>
43
/// <para>
44
/// Initial setup done when the SDK is first needed by a task in Nuke.Unreal. Download and install SDK files
45
/// here and point Unreal to it via setting process environment variables for example. Even if an SDK is
46
/// already downloaded and installed this Setup function would still need to connect Unreal to that.
47
/// </para>
48
/// <para>
49
/// This method can be called multiple times, not only at initialization. Implementations should tread
50
/// accordingly.
51
/// </para>
52
/// </summary>
53
/// <param name="build">
54
/// Current Unreal project, set or get data from it, as that's necessary for this platform SDK
55
/// </param>
56
/// <returns>
57
/// As this can be a long-running process, implementation is recommended to be async
58
/// </returns>
59
Task
Setup
(
IUnrealBuild
build);
60
61
/// <summary>
62
/// Would this SDK be ever valid for the given Unreal project. This check is done before Setup is called.
63
/// It shouldn't yet check if SDK is available locally, only that it can be made available at some point in the
64
/// future.
65
/// For checking if an installed SDK is available locally use <see cref="Exists"/>
66
/// </summary>
67
bool
IsValid
(
IUnrealBuild
build);
68
69
/// <summary>
70
/// A shared user folder for this SDK version, owned by Nuke.Unreal. This may be a parent folder to store all
71
/// the separate SDK versions. To get the path directly to the currently used SDK use <see cref="GetSdkPath"/>
72
/// </summary>
73
AbsolutePath
GetSdkVersionsPath
(
IUnrealBuild
build) => PlatformSdkManager.PlatformSdkRoot /
Host
/
Target
;
74
75
/// <summary>
76
/// The root of the currently used platform SDK in the file system, if there's one.
77
/// </summary>
78
AbsolutePath
GetSdkPath
(
IUnrealBuild
build);
79
80
/// <summary>
81
/// Get the path to a C++ toolchain folder which may be used to compile external C++ code with to maintain
82
/// ABI compatibility if that code needs to link with Unreal.
83
/// </summary>
84
AbsolutePath
GetToolchainPath
(
IUnrealBuild
build) =>
GetSdkPath
(build);
85
86
/// <summary>
87
/// Whether a valid platform SDK exists locally for given project, and is ready to use without further
88
/// downloading and installation.
89
/// </summary>
90
bool
Exists
(
IUnrealBuild
build) =>
IsValid
(build) &&
GetSdkPath
(build).DirectoryExists();
91
92
/// <summary>
93
/// If applicable and XMake can work with the toolchains provided by this SDK, return information for it
94
/// how to do so.
95
/// </summary>
96
/// <param name="build"></param>
97
/// <returns></returns>
98
PlatformSdkXMakeData
?
GetXMakeData
(
IUnrealBuild
build) =>
null
;
99
}
Nuke.Unreal.UnrealPlatform
High level representation of common platforms supported by Unreal Engine (NDA ones excluded) and extr...
Definition
UnrealPlatform.cs:77
Nuke.Unreal.IUnrealBuild
Base interface for build components which require an UnrealBuild main class.
Definition
IUnrealBuild.cs:14
Nuke.Unreal.Platforms.IPlatformSdk
Base interface for implementing the automatic SDK management for a host-target platform pair.
Definition
IPlatformSdk.cs:31
Nuke.Unreal.Platforms.IPlatformSdk.GetSdkPath
AbsolutePath GetSdkPath(IUnrealBuild build)
The root of the currently used platform SDK in the file system, if there's one.
Nuke.Unreal.Platforms.IPlatformSdk.Exists
bool Exists(IUnrealBuild build)
Whether a valid platform SDK exists locally for given project, and is ready to use without further do...
Nuke.Unreal.Platforms.IPlatformSdk.GetToolchainPath
AbsolutePath GetToolchainPath(IUnrealBuild build)
Get the path to a C++ toolchain folder which may be used to compile external C++ code with to maintai...
Nuke.Unreal.Platforms.IPlatformSdk.IsValid
bool IsValid(IUnrealBuild build)
Would this SDK be ever valid for the given Unreal project. This check is done before Setup is called....
Nuke.Unreal.Platforms.IPlatformSdk.Host
UnrealPlatform Host
The platform used for development, hosting this SDK to cross-compile target platform.
Definition
IPlatformSdk.cs:35
Nuke.Unreal.Platforms.IPlatformSdk.Setup
Task Setup(IUnrealBuild build)
Nuke.Unreal.Platforms.IPlatformSdk.GetSdkVersionsPath
AbsolutePath GetSdkVersionsPath(IUnrealBuild build)
A shared user folder for this SDK version, owned by Nuke.Unreal. This may be a parent folder to store...
Nuke.Unreal.Platforms.IPlatformSdk.GetXMakeData
PlatformSdkXMakeData? GetXMakeData(IUnrealBuild build)
If applicable and XMake can work with the toolchains provided by this SDK, return information for it ...
Nuke.Unreal.Platforms.IPlatformSdk.Target
UnrealPlatform Target
The platform targeted by given SDK.
Definition
IPlatformSdk.cs:40
Nuke.Unreal.Platforms
Definition
AndroidBuildCommon.cs:6
Nuke.Unreal.Platforms.PlatformSdkXMakeData
record class PlatformSdkXMakeData(string Arguments, string? Platform=null, Func< ToolEx, ToolEx >? ToolSetup=null)
A record for providing build information for XMake/XRepo when that may be requested.
src
Nuke.Unreal
Platforms
IPlatformSdk.cs
Generated by
1.12.0