[backend] Add codename to assembly metadata
This commit is contained in:
parent
46d5fdc1af
commit
9eb5710e84
2 changed files with 19 additions and 5 deletions
|
@ -16,13 +16,23 @@ public sealed class Config
|
||||||
public sealed class InstanceSection
|
public sealed class InstanceSection
|
||||||
{
|
{
|
||||||
public readonly string Version;
|
public readonly string Version;
|
||||||
|
public readonly string Codename;
|
||||||
|
|
||||||
public InstanceSection()
|
public InstanceSection()
|
||||||
{
|
{
|
||||||
// Get version information from assembly
|
var attributes = Assembly.GetEntryAssembly()!
|
||||||
var version = Assembly.GetEntryAssembly()!
|
|
||||||
.GetCustomAttributes()
|
.GetCustomAttributes()
|
||||||
.OfType<AssemblyInformationalVersionAttribute>()
|
.ToList();
|
||||||
|
|
||||||
|
// Get codename from assembly
|
||||||
|
Codename = attributes
|
||||||
|
.OfType<AssemblyMetadataAttribute>()
|
||||||
|
.FirstOrDefault(p => p.Key == "codename")
|
||||||
|
?.Value ??
|
||||||
|
"unknown";
|
||||||
|
|
||||||
|
// Get version information from assembly
|
||||||
|
var version = attributes.OfType<AssemblyInformationalVersionAttribute>()
|
||||||
.First()
|
.First()
|
||||||
.InformationalVersion;
|
.InformationalVersion;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
|
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<AssemblyMetadata Include="codename" Value="alpha" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||||
<BlazorWebAssemblyOmitDebugProxyOutput>true</BlazorWebAssemblyOmitDebugProxyOutput>
|
<BlazorWebAssemblyOmitDebugProxyOutput>true</BlazorWebAssemblyOmitDebugProxyOutput>
|
||||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||||
|
|
Loading…
Add table
Reference in a new issue