Skip to content

Commit d68cd0c

Browse files
authored
Update to latest client SDK to bring .NET 7 support onto the frameworks tab (#9312)
* Add .NET 7 TFMs * Update to latest NuGet SDK and System.Data.SqlClient to resolve CG alerts I had to modify the TFM resolution code to resolve an Obsolete warning. Existing UT coverage is good and they all passed. Resolve #9313
1 parent f472850 commit d68cd0c

7 files changed

Lines changed: 46 additions & 22 deletions

File tree

src/NuGet.Services.DatabaseMigration/NuGet.Services.DatabaseMigration.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<PrivateAssets>all</PrivateAssets>
7575
</PackageReference>
7676
<PackageReference Include="NuGet.Build.Tasks.Pack">
77-
<Version>6.0.0</Version>
77+
<Version>6.4.0</Version>
7878
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
7979
<PrivateAssets>all</PrivateAssets>
8080
</PackageReference>

src/NuGet.Services.Entities/NuGet.Services.Entities.csproj

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="EntityFramework">
12-
<Version>6.4.0-preview3-19553-01</Version>
13-
</PackageReference>
14-
<PackageReference Include="Newtonsoft.Json">
15-
<Version>13.0.1</Version>
16-
</PackageReference>
17-
<PackageReference Include="NuGet.Frameworks">
18-
<Version>6.0.0</Version>
19-
</PackageReference>
11+
<PackageReference Include="EntityFramework" Version="6.4.0-preview3-19553-01" />
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
13+
<PackageReference Include="NuGet.Frameworks" Version="6.4.0" />
14+
<!-- This was lifted to a top-level dependency to resolve a Component Governance alert. -->
15+
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
2016
</ItemGroup>
2117

2218
<ItemGroup>

src/NuGetGallery.Core/Frameworks/SupportedFrameworks.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ public static class SupportedFrameworks
3333
public static readonly NuGetFramework Net60Tizen = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6, "tizen", EmptyVersion);
3434
public static readonly NuGetFramework Net60TvOs = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6, "tvos", EmptyVersion);
3535
public static readonly NuGetFramework Net60Windows = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version6, "windows", EmptyVersion);
36+
public static readonly NuGetFramework Net70Android = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "android", EmptyVersion);
37+
public static readonly NuGetFramework Net70Ios = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "ios", EmptyVersion);
38+
public static readonly NuGetFramework Net70MacOs = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "macos", EmptyVersion);
39+
public static readonly NuGetFramework Net70MacCatalyst = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "maccatalyst", EmptyVersion);
40+
public static readonly NuGetFramework Net70Tizen = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "tizen", EmptyVersion);
41+
public static readonly NuGetFramework Net70TvOs = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "tvos", EmptyVersion);
42+
public static readonly NuGetFramework Net70Windows = new NuGetFramework(FrameworkIdentifiers.NetCoreApp, Version7, "windows", EmptyVersion);
3643
public static readonly NuGetFramework NetCore = new NuGetFramework(FrameworkIdentifiers.NetCore, EmptyVersion);
3744
public static readonly NuGetFramework NetMf = new NuGetFramework(FrameworkIdentifiers.NetMicro, EmptyVersion);
3845
public static readonly NuGetFramework UAP = new NuGetFramework(FrameworkIdentifiers.UAP, EmptyVersion);
@@ -51,7 +58,9 @@ static SupportedFrameworks()
5158
MonoAndroid, MonoMac, MonoTouch,
5259
Native,
5360
Net11, Net2, Net35, Net4, Net403, Net45, Net451, Net452, Net46, Net461, Net462, Net463, Net47, Net471, Net472, Net48,
54-
Net50, Net50Windows, Net60, Net60Android, Net60Ios, Net60MacCatalyst, Net60MacOs, Net60TvOs, Net60Windows,
61+
Net50, Net50Windows,
62+
Net60, Net60Android, Net60Ios, Net60MacCatalyst, Net60MacOs, Net60TvOs, Net60Windows,
63+
Net70, Net70Android, Net70Ios, Net70MacCatalyst, Net70MacOs, Net70TvOs, Net70Windows,
5564
NetCore, NetCore45, NetCore451,
5665
NetCoreApp10, NetCoreApp11, NetCoreApp20, NetCoreApp21, NetCoreApp22, NetCoreApp30, NetCoreApp31,
5766
NetMf,

src/NuGetGallery.Core/NuGetGallery.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<Version>5.2.6</Version>
4848
</PackageReference>
4949
<PackageReference Include="NuGet.Packaging">
50-
<Version>6.0.0</Version>
50+
<Version>6.4.0</Version>
5151
</PackageReference>
5252
<PackageReference Include="NuGet.Services.FeatureFlags">
5353
<Version>2.106.0</Version>

src/NuGetGallery.Core/Services/AssetFrameworkHelper.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ public static IEnumerable<NuGetFramework> GetAssetFrameworks(string packageId, I
3939
var conventions = new ManagedCodeConventions(runtimeGraph);
4040

4141
// Let's test for tools packages first--they're a special case
42-
var groups = Enumerable.Empty<ContentItemGroup>();
42+
var groups = new List<ContentItemGroup>();
4343
if (packageTypes.Count == 1 && (packageTypes[0] == PackageType.DotnetTool ||
4444
packageTypes[0] == PackageType.DotnetCliTool))
4545
{
4646
// Only a package that is a tool package (and nothing else) will be matched against tools pattern set
47-
groups = items.FindItemGroups(conventions.Patterns.ToolsAssemblies);
47+
items.PopulateItemGroups(conventions.Patterns.ToolsAssemblies, groups);
4848
}
4949
else
5050
{
@@ -67,14 +67,25 @@ public static IEnumerable<NuGetFramework> GetAssetFrameworks(string packageId, I
6767
};
6868

6969
// We'll create a set of "groups" --these are content items which satisfy file pattern sets
70-
var standardGroups = patterns
71-
.SelectMany(p => items.FindItemGroups(p));
70+
foreach (var pattern in patterns)
71+
{
72+
items.PopulateItemGroups(pattern, groups);
73+
}
7274

7375
// Filter out MSBuild assets that don't match the package ID and append to groups we already have
74-
var msbuildGroups = msbuildPatterns
75-
.SelectMany(p => items.FindItemGroups(p))
76-
.Where(g => HasBuildItemsForPackageId(g.Items, packageId));
77-
groups = standardGroups.Concat(msbuildGroups);
76+
var msbuildGroups = new List<ContentItemGroup>();
77+
foreach (var pattern in msbuildPatterns)
78+
{
79+
items.PopulateItemGroups(pattern, msbuildGroups);
80+
}
81+
82+
foreach (var group in msbuildGroups)
83+
{
84+
if (HasBuildItemsForPackageId(group.Items, packageId))
85+
{
86+
groups.Add(group);
87+
}
88+
}
7889
}
7990

8091
// Now that we have a collection of groups which have made it through the pattern set filter, let's transform them into TFMs

src/NuGetGallery.Services/NuGetGallery.Services.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
<Version>4.2.2</Version>
8686
</PackageReference>
8787
<PackageReference Include="NuGet.Protocol">
88-
<Version>6.0.0</Version>
88+
<Version>6.4.0</Version>
8989
</PackageReference>
9090
<PackageReference Include="NuGet.Services.Configuration">
9191
<Version>2.106.0</Version>

src/NuGetGallery/Web.config

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,14 @@
576576
</system.diagnostics>
577577
<runtime>
578578
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
579+
<dependentAssembly>
580+
<assemblyIdentity name="NuGet.Versioning" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
581+
<bindingRedirect oldVersion="0.0.0.0-6.4.0.123" newVersion="6.4.0.123"/>
582+
</dependentAssembly>
583+
<dependentAssembly>
584+
<assemblyIdentity name="NuGet.Packaging" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
585+
<bindingRedirect oldVersion="0.0.0.0-6.4.0.123" newVersion="6.4.0.123"/>
586+
</dependentAssembly>
579587
<dependentAssembly>
580588
<assemblyIdentity name="Microsoft.IdentityModel.Tokens" publicKeyToken="31BF3856AD364E35" culture="neutral"/>
581589
<bindingRedirect oldVersion="0.0.0.0-6.7.1.0" newVersion="6.7.1.0"/>
@@ -674,4 +682,4 @@
674682
</dependentAssembly>
675683
</assemblyBinding>
676684
</runtime>
677-
</configuration>
685+
</configuration>

0 commit comments

Comments
 (0)