Add build metadata

This commit is contained in:
D1GQ committed 2026-01-09 12:42:18 -06:00
1 parent c8136e2274
commit bc96d92fa8
3 files changed
+36 -6

No files matched your search

+2 -2
View File
@@ -42,7 +42,7 @@ internal class BAUPlugin : BasePlugin
text = $"v{BetterAmongUsVersion}{newLineText}Beta {ModInfo.BetaNum}";
break;
case ReleaseTypes.Dev:
text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.ReleaseDate}";
text = $"v{BetterAmongUsVersion}{newLineText}Dev {ModInfo.CommitHash}-{ModInfo.BuildDate}";
break;
default:
break;
@@ -106,7 +106,7 @@ internal class BAUPlugin : BasePlugin
Logger_.Log("Better Among Us successfully loaded!");
string SupportedVersions = string.Join(" ", SupportedAmongUsVersions);
Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.ReleaseDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}");
Logger_.Log($"BetterAmongUs {BetterAmongUsVersion}-{ModInfo.BuildDate} - [{AppVersion} --> {SupportedVersions}] {Utils.GetPlatformName(PlatformData.Platform)}");
}
catch (Exception ex)
{
+20 -2
View File
@@ -7,10 +7,27 @@
<langVersion>preview</langVersion>
</PropertyGroup>
<!-- Build Events -->
<!-- Meta Data -->
<PropertyGroup>
<CommitHash Condition="'$(CommitHash)' == ''">unknown</CommitHash>
<BuildDate>$([System.DateTime]::UtcNow.ToString(MM.dd.yyyy))</BuildDate>
<IsCI Condition="'$(CI)' == 'true' or '$(GITHUB_ACTIONS)' == 'true' or '$(TF_BUILD)' == 'true'">true</IsCI>
<IsCI Condition="'$(IsCI)' == ''">false</IsCI>
</PropertyGroup>
<!-- Build Events -->
<ItemGroup>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>CommitHash</_Parameter1>
<_Parameter2>$(CommitHash)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>BuildDate</_Parameter1>
<_Parameter2>$(BuildDate)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<PropertyGroup>
<ModPathFile>build\mod_folder_path</ModPathFile>
<GamePath Condition="Exists('$(ModPathFile)') and '$(IsCI)' != 'true'">$([System.IO.File]::ReadAllText('$(ModPathFile)').Trim())</GamePath>
<ModsPath>$(GamePath)</ModsPath>
@@ -28,6 +45,7 @@
<Message Text="Mod was NOT copied to game folder!" Importance="high" />
</Target>
<!-- Packages -->
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.11.18" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.0.1">
@@ -37,8 +55,8 @@
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.692" Private="false" ExcludeAssets="runtime;native" />
</ItemGroup>
<!-- Resources -->
<ItemGroup>
<!-- Embed all files in the Resources folder -->
<EmbeddedResource Include="Resources\**\*" />
</ItemGroup>
</Project>
+14 -2
View File
@@ -1,4 +1,6 @@
namespace BetterAmongUs;
using System.Reflection;
namespace BetterAmongUs;
internal static class ModInfo
{
@@ -9,7 +11,17 @@ internal static class ModInfo
internal const string PluginName = "BetterAmongUs";
internal const string PluginGuid = "com.d1gq.betteramongus";
internal const string PluginVersion = "1.3.1";
internal const string ReleaseDate = "01.09.2026"; // mm/dd/yyyy
internal const string Github = "https://github.com/D1GQ/BetterAmongUs-Public";
internal const string Discord = "https://discord.gg/vjYrXpzNAn";
public static string CommitHash => GetAssemblyMetadata("CommitHash");
public static string BuildDate => GetAssemblyMetadata("BuildDate");
private static string GetAssemblyMetadata(string key)
{
var attribute = Assembly.GetExecutingAssembly()
.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(a => a.Key == key);
return attribute?.Value ?? "unknown";
}
}