Skip to content

Commit

Permalink
Merge pull request #25013 from dotnet/darc-release/6.0.4xx-0d36dbf7-9…
Browse files Browse the repository at this point in the history
…2f1-435a-8d11-42ce41b638fb

[release/6.0.4xx] Update dependencies from nuget/nuget.client
  • Loading branch information
v-wuzhai authored Apr 28, 2022
2 parents 43c8366 + 6d79c88 commit 300cc09
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 15 deletions.
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>f9ae0f5d30be2de3c0de61b5673bd8873231d70a</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

0 comments on commit 300cc09

Please sign in to comment.