Include git hash in version

This commit is contained in:
Stephan Sundermann committed 2014-11-12 00:11:26 +01:00
1 parent a8371303c8
commit 207f1a02f0
3 files changed
+12 -3

No files matched your search

+5 -1
View File
@@ -19,6 +19,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Windows.Forms;
using VocaluxeLib; using VocaluxeLib;
namespace Vocaluxe.Base namespace Vocaluxe.Base
@@ -180,8 +181,11 @@ namespace Vocaluxe.Base
// ReSharper disable ConditionIsAlwaysTrueOrFalse // ReSharper disable ConditionIsAlwaysTrueOrFalse
if (VersionRevision != ERevision.Release) if (VersionRevision != ERevision.Release)
{
// ReSharper restore ConditionIsAlwaysTrueOrFalse // ReSharper restore ConditionIsAlwaysTrueOrFalse
version += " " + _GetVersionStatus() + String.Format(" ({0:0000)}", _Assembly.Version.Revision); var gitversion = Application.ProductVersion;
version += " " + _GetVersionStatus() + String.Format(" ({0})", gitversion);
}
return version; return version;
} }
+2 -1
View File
@@ -50,4 +50,5 @@ using System.Runtime.InteropServices;
// //
[assembly: AssemblyVersion("0.3.0.83")] [assembly: AssemblyVersion("0.3.0.83")]
[assembly: AssemblyFileVersion("0.3.0.83")] [assembly: AssemblyFileVersion("0.3.0.83")]
[assembly: AssemblyInformationalVersion("GITVERSION")]
+5 -1
View File
@@ -509,7 +509,11 @@
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>xcopy /E /D /Y "$(ProjectDir)\Website" "$(SolutionDir)\PhoneGap"</PostBuildEvent> <PostBuildEvent>xcopy /E /D /Y "$(ProjectDir)\Website" "$(SolutionDir)\PhoneGap"
powershell -command "(Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace '(?&lt;=AssemblyInformationalVersion\()(.*)(?=\))', '\"GITVERSION\"'} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PreBuildEvent>powershell -command "$version = git describe --long; (Get-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs') | Foreach-Object {$_ -replace 'GITVERSION', $version} | Set-Content -Encoding UTF8 '$(ProjectDir)Properties\AssemblyInfo.cs'"</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.