Skip to content

Commit 6f0bd1e

Browse files
author
Daniel Jacinto
authored
net6.0-windows7 compatibility added. (#9364)
1 parent 92ae551 commit 6f0bd1e

3 files changed

Lines changed: 26 additions & 0 deletions

File tree

src/NuGetGallery.Core/Frameworks/FrameworkCompatibilityService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ private static IReadOnlyDictionary<NuGetFramework, ISet<NuGetFramework>> GetComp
6161
}
6262
}
6363

64+
matrix.Add(SupportedFrameworks.Net60Windows7,
65+
new HashSet<NuGetFramework>() {
66+
SupportedFrameworks.Net60Windows, SupportedFrameworks.Net60Windows7,
67+
SupportedFrameworks.Net70Windows, SupportedFrameworks.Net70Windows7 });
68+
6469
return matrix;
6570
}
6671
}

src/NuGetGallery.Core/Frameworks/SupportedFrameworks.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public static class SupportedFrameworks
5050
public static readonly NuGetFramework XamarinMac = new NuGetFramework(FrameworkIdentifiers.XamarinMac, EmptyVersion);
5151
public static readonly NuGetFramework XamarinTvOs = new NuGetFramework(FrameworkIdentifiers.XamarinTVOS, EmptyVersion);
5252
public static readonly NuGetFramework XamarinWatchOs = new NuGetFramework(FrameworkIdentifiers.XamarinWatchOS, EmptyVersion);
53+
54+
public static readonly NuGetFramework Net60Windows7 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6, "windows", Version7);
55+
public static readonly NuGetFramework Net70Windows7 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "windows", Version7);
5356

5457
public static readonly IReadOnlyList<NuGetFramework> AllSupportedNuGetFrameworks;
5558

tests/NuGetGallery.Core.Facts/Frameworks/FrameworkCompatibilityServiceFacts.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,23 @@ public void ValidPackageFrameworksReturnsFrameworksCompatibleForAtLeastOne(param
9696
Assert.True(isCompatible);
9797
}
9898
}
99+
100+
[Theory]
101+
[InlineData("net6.0-windows7.0", "net6.0-windows", "net6.0-windows7.0", "net7.0-windows", "net7.0-windows7.0")]
102+
public void WindowsPlatformVersionsShouldContainAllSpecifiedFrameworks(string windowsDefaultVersionFramework, params string[] windowsProjectFrameworks)
103+
{
104+
var packageFramework = NuGetFramework.Parse(windowsDefaultVersionFramework);
105+
var projectFrameworks = new HashSet<NuGetFramework>();
106+
107+
foreach (var frameworkName in windowsProjectFrameworks) {
108+
projectFrameworks.Add(NuGetFramework.Parse(frameworkName));
109+
}
110+
111+
var compatibleFrameworks = _service.GetCompatibleFrameworks(new HashSet<NuGetFramework>() { packageFramework });
112+
Assert.Equal(windowsProjectFrameworks.Length, compatibleFrameworks.Count);
113+
114+
var containsAllCompatibleFrameworks = compatibleFrameworks.All(cf => projectFrameworks.Contains(cf));
115+
Assert.True(containsAllCompatibleFrameworks);
116+
}
99117
}
100118
}

0 commit comments

Comments
 (0)