From 2d5c9e4380e04e2a77c54bf91d4018936f2ccda4 Mon Sep 17 00:00:00 2001 From: pragnya17 <59893188+pragnya17@users.noreply.github.com> Date: Thu, 30 Jun 2022 10:32:04 -0700 Subject: [PATCH] Change when info is logged --- .../Utility/MSBuildAPIUtility.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/NuGet.Core/NuGet.CommandLine.XPlat/Utility/MSBuildAPIUtility.cs b/src/NuGet.Core/NuGet.CommandLine.XPlat/Utility/MSBuildAPIUtility.cs index dc9addf3a45..242e3fa1427 100644 --- a/src/NuGet.Core/NuGet.CommandLine.XPlat/Utility/MSBuildAPIUtility.cs +++ b/src/NuGet.Core/NuGet.CommandLine.XPlat/Utility/MSBuildAPIUtility.cs @@ -262,15 +262,13 @@ private void AddPackageVersionIntoPropsItemGroup(Project project, ProjectItemGro // Add both package reference information and version metadata using the PACKAGE_VERSION_TYPE_TAG. var item = itemGroup.AddItem(PACKAGE_VERSION_TYPE_TAG, libraryDependency.Name); var packageVersion = AddVersionMetadata(libraryDependency, item); - + AddExtraMetadataToProjectItemElement(libraryDependency, item); Logger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.Info_AddPkgAdded, libraryDependency.Name, packageVersion, itemGroup.ContainingProject.FullPath )); - - AddExtraMetadataToProjectItemElement(libraryDependency, item); } /// @@ -284,10 +282,8 @@ private void AddPackageReferenceIntoItemGroup(ProjectItemGroupElement itemGroup, // Add both package reference information and version metadata using the PACKAGE_REFERENCE_TYPE_TAG. var item = itemGroup.AddItem(PACKAGE_REFERENCE_TYPE_TAG, libraryDependency.Name); var packageVersion = AddVersionMetadata(libraryDependency, item); - - Logger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.Info_AddPkgAdded, libraryDependency.Name, packageVersion, itemGroup.ContainingProject.FullPath)); - AddExtraMetadataToProjectItemElement(libraryDependency, item); + Logger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.Info_AddPkgAdded, libraryDependency.Name, packageVersion, itemGroup.ContainingProject.FullPath)); } /// @@ -301,10 +297,8 @@ private void AddPackageReferenceIntoItemGroupCPM(Project project, ProjectItemGro { // Only add the package reference information using the PACKAGE_REFERENCE_TYPE_TAG. ProjectItemElement item = itemGroup.AddItem(PACKAGE_REFERENCE_TYPE_TAG, libraryDependency.Name); - - Logger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.Info_AddPkgCPM, libraryDependency.Name, project.GetPropertyValue(DirectoryPackagesPropsPathPropertyName), itemGroup.ContainingProject.FullPath)); - AddExtraMetadataToProjectItemElement(libraryDependency, item); + Logger.LogInformation(string.Format(CultureInfo.CurrentCulture, Strings.Info_AddPkgCPM, libraryDependency.Name, project.GetPropertyValue(DirectoryPackagesPropsPathPropertyName), itemGroup.ContainingProject.FullPath)); } ///