Skip to content

Commit

Permalink
Merge pull request #28 from eulynx-live/log_version
Browse files Browse the repository at this point in the history
Define and log the software version
  • Loading branch information
rs22 authored Jan 15, 2024
2 parents fa003cd + ce2340c commit ba51c62
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/Point/Point.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
using PropertyChanged.SourceGenerator;

using System.ComponentModel;
using System.Diagnostics;
using System.Net.WebSockets;
using System.Reactive;
using System.Reactive.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;

namespace EulynxLive.Point
Expand Down Expand Up @@ -267,6 +269,10 @@ private GenericDegradedPointPosition RespectAllPointMachinesCrucial(GenericDegra

protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
// Log version information
var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion;
_logger.LogInformation("Simulator software version: {}", version ?? "unknown");

// Main loop.
while (!stoppingToken.IsCancellationRequested)
{
Expand Down
14 changes: 14 additions & 0 deletions src/Point/Point.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<IsPackable>false</IsPackable>
<SpaRoot>rasta-point-web\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<Version>1.1.0</Version>
<Company>Systems Lab 21 GmbH</Company>
<Product>EULYNX Point Simulator</Product>
<Description>Simulator for EULYNX SCI-P Electronic Field Element Subsystem</Description>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -79,4 +83,14 @@
<Copy SourceFiles="..\ProtobufInterfaces\proto\point.proto" DestinationFolder="$(PublishDir)$(SpaRoot)build" />
</Target>

<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
<Exec
Command="git describe --long --always --dirty --exclude=* --abbrev=8"
ConsoleToMSBuild="True"
IgnoreExitCode="False"
>
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput"/>
</Exec>
</Target>

</Project>
2 changes: 1 addition & 1 deletion src/Point/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void ConfigureServices(IServiceCollection services)
}
catch (Exception e)
{
Console.WriteLine($"Usage: --PointSettings:LocalId=<> --PointSettings:LocalRastaId=<> --PointSettings:RemoteId=<> --PointSettings:RemoteEndpoint=<>. {e.Message}");
Console.WriteLine($"One of the required configuration options was not provided. {e.Message}");
Environment.Exit(1);
}

Expand Down

0 comments on commit ba51c62

Please sign in to comment.