From 2fc4e4d6db8165f1cfd1ed54a1e5f25f354c538e Mon Sep 17 00:00:00 2001 From: Daniel Cazzulino Date: Mon, 9 Oct 2023 19:10:46 -0300 Subject: [PATCH] Fix copy error in inference targets for package icon We were duplicating the logic for package readme files instead of package icon due to duplicated code. Fixes #436 --- src/NuGetizer.Tasks/NuGetizer.Inference.targets | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/NuGetizer.Tasks/NuGetizer.Inference.targets b/src/NuGetizer.Tasks/NuGetizer.Inference.targets index c6a90d98..0c4423ac 100644 --- a/src/NuGetizer.Tasks/NuGetizer.Inference.targets +++ b/src/NuGetizer.Tasks/NuGetizer.Inference.targets @@ -290,7 +290,7 @@ Copyright (c) .NET Foundation. All rights reserved. <_ExistingReadme Include="@(Content -> WithMetadataValue('Filename', '$(PackageReadmeFilename)'))" Condition="'@(_ExistingReadme)' == ''" /> <_ExistingReadme Include="$(MSBuildProjectDirectory)\$(PackageReadmeFilename)$(PackageReadmeExtension)" Condition="'@(_ExistingReadme)' == '' and Exists('$(MSBuildProjectDirectory)\$(PackageReadmeFilename)$(PackageReadmeExtension)')" /> - @@ -306,15 +306,13 @@ Copyright (c) .NET Foundation. All rights reserved. - <_ExistingIcon Include="@(None -> WithMetadataValue('Filename', '$(PackageReadmeFilename)'))" /> + <_ExistingIcon Include="@(None -> WithMetadataValue('Filename', '$(PackageIconFilename)'))" /> + <_ExistingIcon Include="@(Content -> WithMetadataValue('Filename', '$(PackageIconFilename)'))" Condition="'@(_ExistingIcon)' == ''" /> + <_ExistingIcon Include="$(MSBuildProjectDirectory)\$(PackageIconFilename)$(PackageIconExtension)" Condition="'@(_ExistingIcon)' == '' and Exists('$(MSBuildProjectDirectory)\$(PackageIconFilename)$(PackageIconExtension)')" /> - <_ExistingReadme Include="@(None -> WithMetadataValue('Filename', '$(PackageReadmeFilename)'))" /> - <_ExistingReadme Include="@(Content -> WithMetadataValue('Filename', '$(PackageReadmeFilename)'))" Condition="'@(_ExistingReadme)' == ''" /> - <_ExistingReadme Include="$(MSBuildProjectDirectory)\$(PackageReadmeFilename)$(PackageReadmeExtension)" Condition="'@(_ExistingReadme)' == '' and Exists('$(MSBuildProjectDirectory)\$(PackageReadmeFilename)$(PackageReadmeExtension)')" /> - - + Condition="'%(Extension)' == '$(PackageIconExtension)'" />