mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Core - Embed PluginApiVersion into the assembly metadata
This commit is contained in:
parent
22268fc945
commit
3f1eaeda29
@ -13,6 +13,11 @@
|
|||||||
<PluginApiVersion>1</PluginApiVersion>
|
<PluginApiVersion>1</PluginApiVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<!--Used to embed the above PluginApiVersion property into the assembly as metadata-->
|
||||||
|
<AssemblyMetadata Include="PluginApiVersion" Value="$(PluginApiVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Artemis.Storage\Artemis.Storage.csproj"/>
|
<ProjectReference Include="..\Artemis.Storage\Artemis.Storage.csproj"/>
|
||||||
<ProjectReference Condition="'$(BuildingNuget)' == 'True'" Update="..\Artemis.Storage\Artemis.Storage.csproj" PrivateAssets="All"/>
|
<ProjectReference Condition="'$(BuildingNuget)' == 'True'" Update="..\Artemis.Storage\Artemis.Storage.csproj" PrivateAssets="All"/>
|
||||||
|
|||||||
@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using Artemis.Core.JsonConverters;
|
using Artemis.Core.JsonConverters;
|
||||||
using Artemis.Core.Services;
|
using Artemis.Core.Services;
|
||||||
@ -61,7 +62,8 @@ public static class Constants
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The current API version for plugins
|
/// The current API version for plugins
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static readonly int PluginApiVersion = CoreAssembly.GetName().Version.Major;
|
public static readonly int PluginApiVersion = int.Parse(CoreAssembly.GetCustomAttributes<AssemblyMetadataAttribute>()
|
||||||
|
.First(a => a.Key == "PluginApiVersion").Value);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The plugin info used by core components of Artemis
|
/// The plugin info used by core components of Artemis
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user