From 1de88ccf51878e593c87daaa292de72855f020cf Mon Sep 17 00:00:00 2001 From: Terkoiz Date: Wed, 21 Jun 2023 13:43:15 +0300 Subject: [PATCH] Implemented plugin version autogeneration based on assembly version for Aki.Common Needed to make release packager version setting to work --- project/Aki.Common/Aki.Common.csproj | 28 ++++++++++++++++++- project/Aki.Common/AkiPluginInfo.cs | 10 +++++++ project/Aki.Core/AkiCorePlugin.cs | 3 +- project/Aki.Custom/AkiCustomPlugin.cs | 3 +- project/Aki.Debugging/AkiDebuggingPlugin.cs | 3 +- .../Aki.SinglePlayer/AkiSingleplayerPlugin.cs | 3 +- 6 files changed, 45 insertions(+), 5 deletions(-) create mode 100644 project/Aki.Common/AkiPluginInfo.cs diff --git a/project/Aki.Common/Aki.Common.csproj b/project/Aki.Common/Aki.Common.csproj index c32e131..690ee64 100644 --- a/project/Aki.Common/Aki.Common.csproj +++ b/project/Aki.Common/Aki.Common.csproj @@ -1,7 +1,8 @@  - net472 + 1.0.0.0 + net472 @@ -21,4 +22,29 @@ + + + + $(Version) + +// --- Autogenerated file --- +// ----- Do not modify! ----- + +namespace $(RootNamespace) +{ + public static class AkiPluginInfo + { + public const string PLUGIN_VERSION = "$(BepInExPluginVersion)"%3B + } +} + + .\AkiPluginInfo.cs + + + + + + + + diff --git a/project/Aki.Common/AkiPluginInfo.cs b/project/Aki.Common/AkiPluginInfo.cs new file mode 100644 index 0000000..dd015c9 --- /dev/null +++ b/project/Aki.Common/AkiPluginInfo.cs @@ -0,0 +1,10 @@ +// --- Autogenerated file --- +// ----- Do not modify! ----- + +namespace Aki.Common +{ + public static class AkiPluginInfo + { + public const string PLUGIN_VERSION = "1.0.0.0"; + } +} diff --git a/project/Aki.Core/AkiCorePlugin.cs b/project/Aki.Core/AkiCorePlugin.cs index a4029d9..85d2b9f 100644 --- a/project/Aki.Core/AkiCorePlugin.cs +++ b/project/Aki.Core/AkiCorePlugin.cs @@ -1,10 +1,11 @@ using System; +using Aki.Common; using Aki.Core.Patches; using BepInEx; namespace Aki.Core { - [BepInPlugin("com.spt-aki.core", "AKI.Core", "1.0.0")] + [BepInPlugin("com.spt-aki.core", "AKI.Core", AkiPluginInfo.PLUGIN_VERSION)] class AkiCorePlugin : BaseUnityPlugin { public AkiCorePlugin() diff --git a/project/Aki.Custom/AkiCustomPlugin.cs b/project/Aki.Custom/AkiCustomPlugin.cs index 979d786..50092bd 100644 --- a/project/Aki.Custom/AkiCustomPlugin.cs +++ b/project/Aki.Custom/AkiCustomPlugin.cs @@ -1,4 +1,5 @@ using System; +using Aki.Common; using Aki.Custom.Airdrops.Patches; using Aki.Custom.Patches; using Aki.Custom.Utils; @@ -6,7 +7,7 @@ using BepInEx; namespace Aki.Custom { - [BepInPlugin("com.spt-aki.custom", "AKI.Custom", "1.0.0")] + [BepInPlugin("com.spt-aki.custom", "AKI.Custom", AkiPluginInfo.PLUGIN_VERSION)] class AkiCustomPlugin : BaseUnityPlugin { public AkiCustomPlugin() diff --git a/project/Aki.Debugging/AkiDebuggingPlugin.cs b/project/Aki.Debugging/AkiDebuggingPlugin.cs index 3569cff..9267f2a 100644 --- a/project/Aki.Debugging/AkiDebuggingPlugin.cs +++ b/project/Aki.Debugging/AkiDebuggingPlugin.cs @@ -1,10 +1,11 @@ using System; +using Aki.Common; using Aki.Debugging.Patches; using BepInEx; namespace Aki.Debugging { - [BepInPlugin("com.spt-aki.debugging", "AKI.Debugging", "1.0.0")] + [BepInPlugin("com.spt-aki.debugging", "AKI.Debugging", AkiPluginInfo.PLUGIN_VERSION)] public class AkiDebuggingPlugin : BaseUnityPlugin { public AkiDebuggingPlugin() diff --git a/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs b/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs index 95ecde5..96f8c3f 100644 --- a/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs +++ b/project/Aki.SinglePlayer/AkiSingleplayerPlugin.cs @@ -1,4 +1,5 @@ using System; +using Aki.Common; using Aki.SinglePlayer.Patches.Healing; using Aki.SinglePlayer.Patches.MainMenu; using Aki.SinglePlayer.Patches.Progression; @@ -9,7 +10,7 @@ using BepInEx; namespace Aki.SinglePlayer { - [BepInPlugin("com.spt-aki.singleplayer", "AKI.Singleplayer", "1.0.0")] + [BepInPlugin("com.spt-aki.singleplayer", "AKI.Singleplayer", AkiPluginInfo.PLUGIN_VERSION)] class AkiSingleplayerPlugin : BaseUnityPlugin { public AkiSingleplayerPlugin()