Nuke.Unreal
Build Unreal apps in Style.
Loading...
Searching...
No Matches
AndroidDebuggerBackend.cs
1using System;
2using System.ComponentModel;
3using System.Linq;
4using Newtonsoft.Json;
5using Nuke.Common;
6using Nuke.Common.IO;
7using Nuke.Common.Tooling;
8
9namespace Nuke.Unreal
10{
11 [TypeConverter(typeof(TypeConverter<AndroidDebuggerBackend>))]
12 [JsonConverter(typeof(EnumerationJsonConverter<AndroidDebuggerBackend>))]
13 public class AndroidDebuggerBackend : Enumeration
14 {
15 public static readonly AndroidDebuggerBackend LLDB = new()
16 {
17 Value = nameof(LLDB),
18 ServerProgramName = "lldb-server",
19 ServerProgramPath = cpu => (RelativePath) "toolchains" / "llvm" / "prebuilt" / "windows-x86_64" / "lib64" / "clang" / "9.0.9" / "lib" / "linux" / cpu.AltName,
20 LaunchArguments = (port, pid) => $"platform --listen *:{port}"
21 };
22 public static readonly AndroidDebuggerBackend GDB = new()
23 {
24 Value = nameof(GDB),
25 ServerProgramName = "gdbserver",
26 ServerProgramPath = cpu => (RelativePath) "prebuilt" / $"android-{cpu.ToString().ToLower()}" / "gdbserver" / "gdbserver",
27 LaunchArguments = (port, pid) => $":{port} --attach {pid}"
28 };
29
30 public required string ServerProgramName { get; init; }
31 public required Func<AndroidProcessorArchitecture /* cpu */, RelativePath /* -> pathInNdk */> ServerProgramPath { get; init; }
32 public required Func<int /* port */, int /* pid */, string /* -> args */> LaunchArguments { get; init; }
33
34 public static implicit operator string(AndroidDebuggerBackend configuration)
35 {
36 return configuration.Value;
37 }
38 }
39}