Last active
December 14, 2020 09:38
-
-
Save PadreSVK/53f42138e58824c1805a117cbef15cf2 to your computer and use it in GitHub Desktop.
Sample of .targets for solution wide additing git metadata dlls and autoincrement Versions based on GitVersion
This file contains 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
<Project> | |
<PropertyGroup> | |
<StableVersionBranch>master</StableVersionBranch> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="GitVersionTask" Version="5.5.1"> | |
<PrivateAssets>all</PrivateAssets> | |
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> | |
</PackageReference> | |
</ItemGroup> | |
<!-- do this only for non release branch, GitVersion_BuildMetaDataPadded contains count of commits against last stable build (based on git tag) --> | |
<Target Name="ChangeSuffixVersionForPrerelease" AfterTargets="GetVersion"> | |
<PropertyGroup Condition="'$(GitVersion_BranchName)' != '$(StableVersionBranch)'"> | |
<PackageVersion>$(GitVersion_MajorMinorPatch)-$(GitVersion_PreReleaseLabel)$(GitVersion_BuildMetaDataPadded)</PackageVersion> | |
</PropertyGroup> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment