Compare commits

...

2 commits

Author SHA1 Message Date
erik
725bbf473f feat: display CalVer version in main window only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:26:21 +00:00
erik
c702263770 feat: auto-generate CalVer version from build date
Replace hardcoded AssemblyVersion/AssemblyFileVersion with a CalVer
scheme (YYYY.M.D.HHmm) generated at build time via an MSBuild target
that writes a CalVer.cs file into obj/ before compilation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 13:24:07 +00:00
6 changed files with 22 additions and 10 deletions

View file

@ -26,5 +26,11 @@ namespace MosswartMassacre
// Int64 property keys
internal const int AvailableLuminanceKey = 6;
internal const int MaximumLuminanceKey = 7;
/// <summary>
/// Plugin version derived from assembly version (CalVer: YYYY.M.D.HHmm)
/// </summary>
public static string PluginVersion =>
typeof(Constants).Assembly.GetName().Version.ToString();
}
}

View file

@ -388,4 +388,16 @@
<Error Condition="!Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets'))" />
</Target>
<Import Project="..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets" Condition="Exists('..\packages\Costura.Fody.5.7.0\build\Costura.Fody.targets')" />
<!-- Auto-generate CalVer version: YYYY.M.D.HHmm -->
<Target Name="SetCalVer" BeforeTargets="CoreCompile">
<PropertyGroup>
<CalVerVersion>$([System.DateTime]::UtcNow.ToString("yyyy.M.d.HHmm"))</CalVerVersion>
<CalVerFile>$(IntermediateOutputPath)CalVer.cs</CalVerFile>
</PropertyGroup>
<WriteLinesToFile File="$(CalVerFile)" Overwrite="true"
Lines="using System.Reflection%3B;[assembly: AssemblyVersion(&quot;$(CalVerVersion)&quot;)];[assembly: AssemblyFileVersion(&quot;$(CalVerVersion)&quot;)]" />
<ItemGroup>
<Compile Include="$(CalVerFile)" />
</ItemGroup>
</Target>
</Project>

View file

@ -21,10 +21,4 @@ using System.Runtime.InteropServices;
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("9b6a07e1-ae78-47f4-b09c-174f6a27d7a3")]
// Version information for an assembly consists of the following four values:
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("4.0.0.2")]
[assembly: AssemblyFileVersion("4.0.0.2")]
// Version is auto-generated at build time (CalVer: YYYY.M.D.HHmm)

View file

@ -177,7 +177,7 @@ namespace MosswartMassacre.Views
{
view.Visible = true;
view.ShowInBar = true;
view.Title = "Mossy Tracker v5.0.0.0";
view.Title = "Mossy Tracker";
}
RefreshAllData();

View file

@ -59,7 +59,7 @@ namespace MosswartMassacre.Views
// Set window properties
if (doTitle)
{
properties.Title = "Mosswart Massacre v5.0.0.0";
properties.Title = $"Mosswart Massacre v{Constants.PluginVersion}";
}
if (doIcon)
@ -91,7 +91,7 @@ namespace MosswartMassacre.Views
if (doTitle)
{
properties.Title = "Mosswart Massacre v5.0.0.0";
properties.Title = $"Mosswart Massacre v{Constants.PluginVersion}";
}
if (doIcon)