Skip to content

Commit

Permalink
Copy icon/readme to output directory if packable
Browse files Browse the repository at this point in the history
  • Loading branch information
kzu committed Jan 30, 2024
1 parent 9a5641b commit 2d10c5c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,23 @@
<!-- Project-level icon/readme will already be part of None items -->
<None Update="@(None -> WithMetadataValue('Filename', 'icon'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
Condition="'$(PackageIcon)' != ''" />

<None Update="@(None -> WithMetadataValue('Filename', 'readme'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
CopyToOutputDirectory="PreserveNewest"
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="PreserveNewest"
Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)\icon.png')" />

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

Expand Down

0 comments on commit 2d10c5c

Please sign in to comment.