Repository navigation
Expand file tree
/
Copy pathIWorkloadManifestProvider.cs
More file actions
59 lines (49 loc) · 1.96 KB
/
Copy pathIWorkloadManifestProvider.cs
File metadata and controls
59 lines (49 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Microsoft.NET.Sdk.WorkloadManifestReader
{
/// <summary>
/// Specifies how the manifest provider should handle corrupt or missing workload manifests.
/// </summary>
public enum ManifestCorruptionFailureMode
{
/// <summary>
/// Attempt to repair using the CorruptionRepairer if available, otherwise throw.
/// This is the default mode for commands that modify workloads.
/// </summary>
Repair,
/// <summary>
/// Throw a helpful error message suggesting how to fix the issue.
/// Use this for read-only/info commands.
/// </summary>
Throw,
/// <summary>
/// Silently ignore missing manifests and continue.
/// Use this for history recording or other scenarios where missing manifests are acceptable.
/// </summary>
Ignore
}
/// <summary>
/// This abstracts out the process of locating and loading a set of manifests to be loaded into a
/// workload manifest resolver and resolved into a single coherent model.
/// </summary>
public interface IWorkloadManifestProvider
{
void RefreshWorkloadManifests();
IEnumerable<ReadableWorkloadManifest> GetManifests();
string GetSdkFeatureBand();
WorkloadVersionInfo GetWorkloadVersion();
Dictionary<string, WorkloadSet> GetAvailableWorkloadSets();
public readonly record struct WorkloadVersionInfo(string Version, bool IsInstalled = true, bool WorkloadSetsEnabledWithoutWorkloadSet = false, string? GlobalJsonPath = null, bool? GlobalJsonSpecifiesWorkloadSets = null);
}
public record WorkloadVersion
{
public enum Type
{
WorkloadSet,
LooseManifest
}
public string? Version;
public Type WorkloadInstallType;
}
}