Skip to content

Commit

Permalink
Merge pull request #34 from Toumash/feature/gitinfo
Browse files Browse the repository at this point in the history
adds build git commit info + tag
  • Loading branch information
Toumash authored Dec 3, 2019
2 parents 544ed48 + 98deec1 commit c0cfcfc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DailyStatus.Common/BuildInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DailyStatus.Common
{
public static class DailyStatusBuildInfo
{
public static string ShortVersion => $"{ThisAssembly.Git.BaseTag}-{ThisAssembly.Git.Commit}";
public static string LongVersion => $"{ThisAssembly.Git.BaseTag}-{ThisAssembly.Git.Branch}-{ThisAssembly.Git.Commit}-{ThisAssembly.Git.Commits + (ThisAssembly.Git.IsDirty ? "-dirty" : "")}";
}
}
10 changes: 10 additions & 0 deletions DailyStatus.Common/DailyStatus.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<AssemblyName>DailyStatus.Common</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -81,6 +83,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="BLL\WorkDaysCalculator.cs" />
<Compile Include="BuildInfo.cs" />
<Compile Include="Configuration\AppConfig.cs" />
<Compile Include="Configuration\DailyStatusConfiguration.cs" />
<Compile Include="Extensions\DateTimeExtensions.cs" />
Expand All @@ -96,4 +99,11 @@
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\GitInfo.2.0.21\build\GitInfo.targets" Condition="Exists('..\packages\GitInfo.2.0.21\build\GitInfo.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\GitInfo.2.0.21\build\GitInfo.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\GitInfo.2.0.21\build\GitInfo.targets'))" />
</Target>
</Project>
1 change: 1 addition & 0 deletions DailyStatus.Common/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="CredentialManagement" version="1.0.2" targetFramework="net461" />
<package id="GitInfo" version="2.0.21" targetFramework="net461" developmentDependency="true" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.3" targetFramework="net461" />
<package id="System.Reactive.Core" version="3.1.1" targetFramework="net461" />
Expand Down
2 changes: 2 additions & 0 deletions DailyStatus.UI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@
</setting>
</DailyStatus.UI.Properties.Settings>
</userSettings>
<runtime>
</runtime>
</configuration>
1 change: 1 addition & 0 deletions DailyStatus.UI/ViewModel/StatusViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public List<MenuItem> ContextMenu
SumSince = prompt.Date ?? new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
})
});
items.Add(new MenuItem() { Header = DailyStatusBuildInfo.ShortVersion, Command = new RelayCommand((_)=> { })});
items.Add(new MenuItem() { Header = "Minimize", Command = new RelayCommand((_) => WindowState = WindowState.Minimized) });
items.Add(new MenuItem() { Header = "Close", Command = CloseCommand });
return items;
Expand Down

0 comments on commit c0cfcfc

Please sign in to comment.