Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <Project>
  2. <Target Name="AddGitCommitCountToVersion"
  3. BeforeTargets="PrepareForBuild;GenerateNuSpec"
  4. Condition=" '$(DisableGitVersionSuffix)' != 'true' ">
  5.  
  6. <Exec Command="git rev-list --count HEAD" ConsoleToMSBuild="true" StandardOutputImportance="low">
  7. <Output TaskParameter="ConsoleOutput" PropertyName="GitCommitCount" />
  8. </Exec>
  9.  
  10. <PropertyGroup>
  11. <PreReleaseLabel Condition=" '$(PreReleaseLabel)' == '' ">beta</PreReleaseLabel>
  12. <VersionCommitCountSuffix>$(GitCommitCount.PadLeft(6, '0'))</VersionCommitCountSuffix>
  13. <Version>$(Version)-$(PreReleaseLabel)-$(VersionCommitCountSuffix)</Version>
  14. <PackageVersion>$(Version)</PackageVersion>
  15. </PropertyGroup>
  16. </Target>
  17. </Project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement