Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/6.0.4xx] Update dependencies from nuget/nuget.client #25013

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore</Uri>
<Sha>c911002ab43b7b989ed67090f2a48d9073d5118d</Sha>
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.2.0-rc.140">
<Dependency Name="NuGet.Build.Tasks" Version="6.3.0-preview.1.32">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>6f54dbd49fcda01ca8d71eb4fa4eea6ef54379ab</Sha>
<Sha>c94327e5fc8d071f4b8ad4b8ee41c7282d6fb3fc</Sha>
</Dependency>
<Dependency Name="Microsoft.Build.NuGetSdkResolver" Version="6.2.0-rc.140">
<Dependency Name="Microsoft.Build.NuGetSdkResolver" Version="6.3.0-preview.1.32">
<Uri>https://github.com/nuget/nuget.client</Uri>
<Sha>6f54dbd49fcda01ca8d71eb4fa4eea6ef54379ab</Sha>
<Sha>c94327e5fc8d071f4b8ad4b8ee41c7282d6fb3fc</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="17.2.0-release-20220408-11">
<Uri>https://github.com/microsoft/vstest</Uri>
Expand Down
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/nuget/nuget.client -->
<NuGetBuildTasksPackageVersion>6.2.0-rc.140</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksPackageVersion>6.3.0-preview.1.32</NuGetBuildTasksPackageVersion>
<NuGetBuildTasksConsolePackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksConsolePackageVersion>
<NuGetLocalizationPackageVersion>6.0.0</NuGetLocalizationPackageVersion>
<NuGetBuildTasksPackPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetBuildTasksPackPackageVersion>
<NuGetCommandLineXPlatPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommandLineXPlatPackageVersion>
<NuGetProjectModelPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetProjectModelPackageVersion>
<MicrosoftBuildNuGetSdkResolverPackageVersion>6.2.0-rc.140</MicrosoftBuildNuGetSdkResolverPackageVersion>
<MicrosoftBuildNuGetSdkResolverPackageVersion>6.3.0-preview.1.32</MicrosoftBuildNuGetSdkResolverPackageVersion>
<NuGetCommonPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetCommonPackageVersion>
<NuGetConfigurationPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetConfigurationPackageVersion>
<NuGetFrameworksPackageVersion>$(NuGetBuildTasksPackageVersion)</NuGetFrameworksPackageVersion>
Expand Down
23 changes: 14 additions & 9 deletions src/Tasks/Microsoft.NET.Build.Tasks/ResolveAppHosts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected override void ExecuteCore()
return;
}

var packagesToDownload = new List<ITaskItem>();
var packagesToDownload = new Dictionary<string,string>();

if (!string.IsNullOrEmpty(AppHostRuntimeIdentifier))
{
Expand Down Expand Up @@ -204,13 +204,19 @@ protected override void ExecuteCore()

if (packagesToDownload.Any())
{
PackagesToDownload = packagesToDownload.ToArray();
PackagesToDownload = packagesToDownload.Select(ToPackageDownload).ToArray();
}
}

private ITaskItem ToPackageDownload(KeyValuePair<string, string> packageInformation) {
var item = new TaskItem(packageInformation.Key);
item.SetMetadata(MetadataKeys.Version, packageInformation.Value);
return item;
}

private ITaskItem GetHostItem(string runtimeIdentifier,
List<ITaskItem> knownAppHostPacksForTargetFramework,
List<ITaskItem> packagesToDownload,
IDictionary<string, string> packagesToDownload,
string hostNameWithoutExtension,
string itemName,
bool isExecutable,
Expand Down Expand Up @@ -286,7 +292,7 @@ private ITaskItem GetHostItem(string runtimeIdentifier,
else
{
// C++/CLI does not support package download && dedup error
if (!NuGetRestoreSupported && !packagesToDownload.Any(p => p.ItemSpec == hostPackName))
if (!NuGetRestoreSupported && !packagesToDownload.ContainsKey(hostPackName))
{
Log.LogError(
Strings.TargetingApphostPackMissingCannotRestore,
Expand All @@ -298,11 +304,10 @@ private ITaskItem GetHostItem(string runtimeIdentifier,
);
}

// Download apphost pack
TaskItem packageToDownload = new TaskItem(hostPackName);
packageToDownload.SetMetadata(MetadataKeys.Version, appHostPackVersion);

packagesToDownload.Add(packageToDownload);
// use the first one added
if (!packagesToDownload.ContainsKey(hostPackName)) {
packagesToDownload.Add(hostPackName, appHostPackVersion);
}

appHostItem.SetMetadata(MetadataKeys.NuGetPackageId, hostPackName);
appHostItem.SetMetadata(MetadataKeys.NuGetPackageVersion, appHostPackVersion);
Expand Down