Update BepInEx ver and metadata management

This commit is contained in:
D1GQ committed 2026-06-22 19:33:23 -05:00
1 parent 9421b08431
commit 1d3e8a033e
4 files changed
+28 -47

No files matched your search

+22 -44
View File
@@ -16,52 +16,16 @@
<Error Condition="'$(ScriptExitCode)' != '0'" Text="Il2Cpp compatibility check failed. See errors in error list." />
</Target>
<!-- Git Commit Hash Retrieval -->
<Target Name="GetGitCommitHash" BeforeTargets="BeforeBuild">
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" IgnoreExitCode="true" StandardErrorImportance="low" WorkingDirectory="$(MSBuildProjectDirectory)">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
</Exec>
<PropertyGroup Condition="'$(CommitHash)' == ''">
<CommitHash>unknown</CommitHash>
</PropertyGroup>
<Message Text="Git commit hash: $(CommitHash)" Importance="high" />
</Target>
<!-- Git Commit Hash Retrieval -->
<Target Name="GetGitCommitHash" BeforeTargets="BeforeBuild">
<Exec Command="git rev-parse --short HEAD" ConsoleToMSBuild="true" IgnoreExitCode="true" StandardErrorImportance="low" WorkingDirectory="$(MSBuildProjectDirectory)">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitHash" />
</Exec>
<PropertyGroup Condition="'$(CommitHash)' == ''">
<CommitHash>unknown</CommitHash>
</PropertyGroup>
<Message Text="Git commit hash: $(CommitHash)" Importance="high" />
</Target>
<!-- Build Metadata -->
<PropertyGroup>
<CommitHash Condition="'$(CommitHash)' == ''">unknown</CommitHash>
<BuildDate>$([System.DateTime]::UtcNow.ToString("MM.dd.yyyy"))</BuildDate>
<BuildDate>$([System.DateTime]::Now.ToString("MM.dd.yyyy"))</BuildDate>
</PropertyGroup>
<!-- Target to add assembly metadata (runs AFTER GetGitCommitHash) -->
<Target Name="AddAssemblyMetadata" AfterTargets="GetGitCommitHash" BeforeTargets="BeforeBuild">
<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>
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute">
<_Parameter1>BuildConfiguration</_Parameter1>
<_Parameter2>$(Configuration)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
<Message Text="Added assembly metadata: CommitHash=$(CommitHash), BuildDate=$(BuildDate)" Importance="normal" />
</Target>
<!-- Define metadata for ThisAssembly.Metadata -->
<ItemGroup>
<AssemblyMetadata Include="BuildDate" Value="$(BuildDate)" />
<AssemblyMetadata Include="BuildConfiguration" Value="$(Configuration)" />
</ItemGroup>
<!-- Game Path Configuration -->
<PropertyGroup>
@@ -91,14 +55,28 @@
<Warning Text="Game path not found. Create $(ModPathFile) with game folder path." Condition="'$(CopyToGame)' == 'true' and ('$(GamePath)' == '' or !Exists('$(GamePath)'))" />
</Target>
<!-- NuGet Packages -->
<!-- NuGet Core Packages -->
<ItemGroup>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2026.6.5" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="2.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.692" Private="false" ExcludeAssets="runtime;native" />
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" Private="false" ExcludeAssets="runtime;native" />
</ItemGroup>
<!-- NuGet Info Packages -->
<ItemGroup>
<PackageReference Include="GitInfo" Version="3.3.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="ThisAssembly.Metadata" Version="2.1.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
</ItemGroup>
<!-- Embedded Resources -->
+2
View File
@@ -3,6 +3,8 @@ using BetterAmongUs.Utilities;
using System.Reflection;
using UnityEngine;
namespace BetterAmongUs.Managers;
/// <summary>
/// Manages audio override files and their corresponding AudioClip data.
/// </summary>
+2 -2
View File
@@ -17,12 +17,12 @@ internal static class ModInfo
/// <summary>
/// Gets the Git commit hash from assembly metadata.
/// </summary>
public static string CommitHash = GetAssemblyMetadata("CommitHash");
public static string CommitHash = ThisAssembly.Git.Commit;
/// <summary>
/// Gets the build date from assembly metadata.
/// </summary>
public static string BuildDate = GetAssemblyMetadata("BuildDate");
public static string BuildDate = ThisAssembly.Metadata.BuildDate;
/// <summary>
/// The beta number for beta releases.
+2 -1
View File
@@ -1,4 +1,5 @@
using HarmonyLib;
using BetterAmongUs.Managers;
using HarmonyLib;
namespace BetterAmongUs.Patches.Client;