Skip to content

Commit

Permalink
net6.0-windows7 compatibility added. (#9364)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyjdev authored Jan 30, 2023
1 parent 92ae551 commit 6f0bd1e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ private static IReadOnlyDictionary<NuGetFramework, ISet<NuGetFramework>> GetComp
}
}

matrix.Add(SupportedFrameworks.Net60Windows7,
new HashSet<NuGetFramework>() {
SupportedFrameworks.Net60Windows, SupportedFrameworks.Net60Windows7,
SupportedFrameworks.Net70Windows, SupportedFrameworks.Net70Windows7 });

return matrix;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/NuGetGallery.Core/Frameworks/SupportedFrameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public static class SupportedFrameworks
public static readonly NuGetFramework XamarinMac = new NuGetFramework(FrameworkIdentifiers.XamarinMac, EmptyVersion);
public static readonly NuGetFramework XamarinTvOs = new NuGetFramework(FrameworkIdentifiers.XamarinTVOS, EmptyVersion);
public static readonly NuGetFramework XamarinWatchOs = new NuGetFramework(FrameworkIdentifiers.XamarinWatchOS, EmptyVersion);

public static readonly NuGetFramework Net60Windows7 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6, "windows", Version7);
public static readonly NuGetFramework Net70Windows7 = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "windows", Version7);

public static readonly IReadOnlyList<NuGetFramework> AllSupportedNuGetFrameworks;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,23 @@ public void ValidPackageFrameworksReturnsFrameworksCompatibleForAtLeastOne(param
Assert.True(isCompatible);
}
}

[Theory]
[InlineData("net6.0-windows7.0", "net6.0-windows", "net6.0-windows7.0", "net7.0-windows", "net7.0-windows7.0")]
public void WindowsPlatformVersionsShouldContainAllSpecifiedFrameworks(string windowsDefaultVersionFramework, params string[] windowsProjectFrameworks)
{
var packageFramework = NuGetFramework.Parse(windowsDefaultVersionFramework);
var projectFrameworks = new HashSet<NuGetFramework>();

foreach (var frameworkName in windowsProjectFrameworks) {
projectFrameworks.Add(NuGetFramework.Parse(frameworkName));
}

var compatibleFrameworks = _service.GetCompatibleFrameworks(new HashSet<NuGetFramework>() { packageFramework });
Assert.Equal(windowsProjectFrameworks.Length, compatibleFrameworks.Count);

var containsAllCompatibleFrameworks = compatibleFrameworks.All(cf => projectFrameworks.Contains(cf));
Assert.True(containsAllCompatibleFrameworks);
}
}
}

0 comments on commit 6f0bd1e

Please sign in to comment.