forked from dotnet/try-convert
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Packages.cs
61 lines (52 loc) · 1.94 KB
/
Packages.cs
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
60
61
namespace MSBuild.Conversion.Package
{
public class PackagesConfigPackage
{
/// <summary>
/// Name of the package.
/// </summary>
public string ID { get; set; }
/// <summary>
/// Exact version of the package depended upon.
/// </summary>
public string Version { get; set; }
/// <summary>
/// Optional TFM that the package dependency applies to.
/// </summary>
public string TargetFramework { get; set; }
/// <summary>
/// Optional string of allowed versions that follow the NuGet spec for syntax.
/// </summary>
public string AllowedVersions { get; set; }
/// <summary>
/// Optional flag for use only in development; the package will not be included when a consuming package is created.
/// </summary>
public bool DevelopmentDependency { get; set; } = false;
}
public class PackageReferencePackage
{
/// <summary>
/// Name of the package.
/// </summary>
public string ID { get; set; }
/// <summary>
/// Exact version of the package depended upon.
/// </summary>
public string Version { get; set; }
/// <summary>
/// Optional TFM that the package dependency applies to.
/// </summary>
public string TargetFramework { get; set; }
/// <summary>
/// Optional flag for use only in development; the package will not be included when a consuming package is created.
/// </summary>
public bool DevelopmentDependency { get; set; } = false;
public PackageReferencePackage(PackagesConfigPackage pcp)
{
ID = pcp.ID;
Version = string.IsNullOrWhiteSpace(pcp.AllowedVersions) ? pcp.Version : pcp.AllowedVersions;
TargetFramework = pcp.TargetFramework;
DevelopmentDependency = pcp.DevelopmentDependency;
}
}
}