[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 readonly string Version;
|
||||
public readonly string Codename;
|
||||
|
||||
public InstanceSection()
|
||||
{
|
||||
// Get version information from assembly
|
||||
var version = Assembly.GetEntryAssembly()!
|
||||
var attributes = Assembly.GetEntryAssembly()!
|
||||
.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()
|
||||
.InformationalVersion;
|
||||
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AssemblyMetadata Include="codename" Value="alpha" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<BlazorWebAssemblyOmitDebugProxyOutput>true</BlazorWebAssemblyOmitDebugProxyOutput>
|
||||
<PreserveCompilationContext>false</PreserveCompilationContext>
|
||||
|
|
Loading…
Add table
Reference in a new issue