Last active
August 7, 2019 01:01
-
-
Save usausa/3f512fe04b910d6be7deef479db595e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0"?> | |
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
| <PropertyGroup> | |
| <GenerateFileName>$(AssemblyName).sha256</GenerateFileName> | |
| </PropertyGroup> | |
| <!-- For build output --> | |
| <Target Name="GenerateGetCopyToOutputDirectoryItems" | |
| BeforeTargets="GetCopyToOutputDirectoryItems"> | |
| <Message Text="**** GenerateGetCopyToOutputDirectoryItems ****"/> | |
| <PropertyGroup> | |
| <GenerateFullPath>$([System.IO.Path]::GetFullPath('$(OutputPath)$(GenerateFileName)'))</GenerateFullPath> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <FileWrites Include="$(OutputPath)$(GenerateFileName)"/> | |
| <AllItemsFullPathWithTargetPath Include="$(GenerateFullPath)"> | |
| <TargetPath>$(GenerateFileName)</TargetPath> | |
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
| </AllItemsFullPathWithTargetPath> | |
| </ItemGroup> | |
| </Target> | |
| <!-- For publish output --> | |
| <Target Name="GenerateGetCopyToPublishDirectoryItems" | |
| BeforeTargets="GetCopyToPublishDirectoryItems" | |
| Returns="@(AllPublishItemsFullPathWithTargetPath)"> | |
| <Message Text="**** GenerateGetCopyToPublishDirectoryItems ****"/> | |
| <PropertyGroup> | |
| <GenerateFullPath>$([System.IO.Path]::GetFullPath('$(OutputPath)$(GenerateFileName)'))</GenerateFullPath> | |
| </PropertyGroup> | |
| <Message Text="$(GenerateFullPath)"/> | |
| <ItemGroup> | |
| <AllPublishItemsFullPathWithTargetPath Include="$(GenerateFullPath)"> | |
| <TargetPath>$(GenerateFileName)</TargetPath> | |
| <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | |
| </AllPublishItemsFullPathWithTargetPath> | |
| </ItemGroup> | |
| </Target> | |
| <!-- Generate additional item --> | |
| <Target Name="GenerateAdditionalItems" | |
| AfterTargets="Build" | |
| Inputs="$(OutputPath)$(TargetFileName)" | |
| Outputs="$(OutputPath)$(GenerateFileName)"> | |
| <Message Text="**** GenerateAdditionalItems ****"/> | |
| <GetFileHash Files="$(OutputPath)$(TargetFileName)"> | |
| <Output TaskParameter="Items" ItemName="Hash" /> | |
| </GetFileHash> | |
| <WriteLinesToFile File="$(OutputPath)$(GenerateFileName)" Lines="@(Hash->'%(FileHash)')" Overwrite="true"/> | |
| </Target> | |
| </Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment