|
| ValueTask | LogEventAsync (in IkvmToolDiagnosticEvent @event, CancellationToken cancellationToken) |
| | Logs an event if a listener is provided.
|
| |
| ValueTask | LogEventAsync (IkvmToolDiagnosticEventLevel level, string message, string[] args, CancellationToken cancellationToken) |
| | Logs an anonymous event if a listener is provided.
|
| |
| ValueTask | ParseAndLogEventAsync (string line, CancellationToken cancellationToken) |
| | Parses the line and logs it.
|
| |
| IkvmToolDiagnosticEvent | ParseEvent (string line) |
| | Parse a line of JSON tool output into a diagnostic event.
|
| |
Definition at line 14 of file IkvmToolLauncher.cs.
◆ IkvmToolLauncher()
Initializes a new instance.
- Parameters
-
| toolName | |
| toolPath | |
| listener | |
Definition at line 27 of file IkvmToolLauncher.cs.
28 {
29 this.toolName = toolName ?? throw new ArgumentNullException(nameof(toolName));
30 this.toolPath = toolPath ?? throw new ArgumentNullException(nameof(toolPath));
31 this.listener = listener;
32
33 if (Directory.Exists(toolPath) == false)
34 throw new DirectoryNotFoundException($"Could not locate tool path {toolPath}.");
35 }
◆ GetToolExe()
| string? IKVM.Tools.Runner.IkvmToolLauncher.GetToolExe |
( |
| ) |
|
Gets the path to executable for the given environment.
- Returns
- Exceptions
-
| ArgumentNullException | |
| NotImplementedException | |
Definition at line 98 of file IkvmToolLauncher.cs.
99 {
100 foreach (var name in (Span<string>)[toolName + ".exe", toolName])
101 if (File.Exists(Path.Combine(toolPath, name)))
102 return Path.Combine(toolPath, name);
103
104 return null;
105 }
◆ LogEventAsync() [1/2]
| ValueTask IKVM.Tools.Runner.IkvmToolLauncher.LogEventAsync |
( |
IkvmToolDiagnosticEventLevel | level, |
|
|
string | message, |
|
|
string[] | args, |
|
|
CancellationToken | cancellationToken ) |
|
protected |
Logs an anonymous event if a listener is provided.
- Parameters
-
- Returns
Definition at line 54 of file IkvmToolLauncher.cs.
◆ LogEventAsync() [2/2]
| ValueTask IKVM.Tools.Runner.IkvmToolLauncher.LogEventAsync |
( |
in IkvmToolDiagnosticEvent @ | event, |
|
|
CancellationToken | cancellationToken ) |
|
protected |
Logs an event if a listener is provided.
- Parameters
-
- Returns
Definition at line 42 of file IkvmToolLauncher.cs.
◆ ParseAndLogEventAsync()
| ValueTask IKVM.Tools.Runner.IkvmToolLauncher.ParseAndLogEventAsync |
( |
string | line, |
|
|
CancellationToken | cancellationToken ) |
|
protected |
◆ ParseEvent()
| IkvmToolDiagnosticEvent IKVM.Tools.Runner.IkvmToolLauncher.ParseEvent |
( |
string | line | ) |
|
|
protected |
Parse a line of JSON tool output into a diagnostic event.
- Parameters
-
- Returns
Definition at line 75 of file IkvmToolLauncher.cs.
76 {
77 try
78 {
79 var buffer = Encoding.UTF8.GetBytes(line);
80 var reader = new Utf8JsonReader(buffer);
81 if (reader.Read() == false)
82 throw new JsonException();
83
85 }
86 catch (JsonException)
87 {
89 }
90 }
The documentation for this class was generated from the following file: