Auto-Version aus Git-Tag via Directory.Build.props
This commit is contained in:
parent
aa38762021
commit
62c36acc48
3 changed files with 20 additions and 6 deletions
20
Directory.Build.props
Normal file
20
Directory.Build.props
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- Version aus Git-Tag lesen: git tag v1.2.3 → Version 1.2.3 -->
|
||||||
|
<GitVersion Condition="'$(GitVersion)' == ''">$([System.String]::Copy('1.0.0'))</GitVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Target Name="SetVersionFromGit" BeforeTargets="GetAssemblyVersion;Build;Publish">
|
||||||
|
<Exec Command="git describe --tags --abbrev=0 2>nul" ConsoleToMSBuild="true" IgnoreExitCode="true">
|
||||||
|
<Output TaskParameter="ConsoleOutput" PropertyName="GitTagRaw" />
|
||||||
|
</Exec>
|
||||||
|
<PropertyGroup>
|
||||||
|
<!-- v1.2.3 → 1.2.3 -->
|
||||||
|
<GitTagClean>$(GitTagRaw.TrimStart('v').Trim())</GitTagClean>
|
||||||
|
<Version Condition="'$(GitTagClean)' != ''">$(GitTagClean)</Version>
|
||||||
|
<AssemblyVersion Condition="'$(GitTagClean)' != ''">$(GitTagClean).0</AssemblyVersion>
|
||||||
|
<FileVersion Condition="'$(GitTagClean)' != ''">$(GitTagClean).0</FileVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Message Text="Build-Version: $(Version)" Importance="high" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
<RootNamespace>MailPrint</RootNamespace>
|
<RootNamespace>MailPrint</RootNamespace>
|
||||||
<AssemblyName>MailPrint</AssemblyName>
|
<AssemblyName>MailPrint</AssemblyName>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.0.0</FileVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@
|
||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<RootNamespace>MailPrintConfig</RootNamespace>
|
<RootNamespace>MailPrintConfig</RootNamespace>
|
||||||
<AssemblyName>MailPrintConfig</AssemblyName>
|
<AssemblyName>MailPrintConfig</AssemblyName>
|
||||||
<Version>1.0.0</Version>
|
|
||||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
|
||||||
<FileVersion>1.0.0.0</FileVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue