-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
26 lines (26 loc) · 1.24 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="GetGitMetadata">
<Target Name="GetGitMetadata">
<Exec Command="git rev-parse --abbrev-ref HEAD" ConsoleToMSBuild="true"
Condition="'$(GitBranchName)' == ''">
<Output TaskParameter="ConsoleOutput" PropertyName="GitBranchName" />
</Exec>
<Exec Command="git rev-list --count HEAD" ConsoleToMSBuild="true"
Condition="'$(GitBuildNumber)' == ''">
<Output TaskParameter="ConsoleOutput" PropertyName="GitBuildNumber" />
</Exec>
<PropertyGroup>
<GitBranchName Condition="'$(GitBranchName)' == ''"/>
<GitBuildNumber Condition="'$(GitBuildNumber)' == ''">0</GitBuildNumber>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<FileVersion>$(VersionPrefix).$(GitBuildNumber)</FileVersion>
<InformationalVersion>$(Version) $(GitBranchName)</InformationalVersion>
</PropertyGroup>
</Target>
<PropertyGroup>
<Authors>Vladislav Borovikov</Authors>
<Company>$(Authors)</Company>
<Copyright>Copyright © 2023-2024 Vladislav Borovikov</Copyright>
<Product>$(Title)</Product>
<AssemblyTitle>$(Description)</AssemblyTitle>
</PropertyGroup>
</Project>