Skip to content

Commit

Permalink
Don't copy default icon to output directory
Browse files Browse the repository at this point in the history
Avoids some errors when packing without building in packaging projects.
  • Loading branch information
kzu committed Sep 16, 2024
1 parent 5f92a68 commit 9263184
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,28 @@

<ItemGroup Condition="'$(IsPackable)' == 'true'" Label="NuGet">
<!-- This is compatible with nugetizer and SDK pack -->
<!-- Only difference is we don't copy either to output directory -->

<!-- Project-level icon/readme will already be part of None items -->
<None Update="@(None -> WithMetadataValue('Filename', 'icon'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="Never"
Condition="'$(PackageIcon)' != ''" />

<None Update="@(None -> WithMetadataValue('Filename', 'readme'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="Never"
Condition="'$(PackReadme)' != 'false' and '$(PackageReadmeFile)' != ''" />

<!-- src-level will need explicit inclusion -->
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png" Visible="false"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="Never"
Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)\icon.png')" />

<None Include="$(MSBuildThisFileDirectory)readme.md" Link="readme.md"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="Never"
Condition="'$(PackReadme)' != 'false' and Exists('$(MSBuildThisFileDirectory)readme.md') and !Exists('$(MSBuildProjectDirectory)\readme.md')" />
</ItemGroup>

Expand Down

0 comments on commit 9263184

Please sign in to comment.