Scope the CultLib pin guard to projects that reference CultMath

Directory.Build.targets is imported by Unity's generated root csprojs too,
which take CultMath from the UPM DLL, so IDE builds of Assembly-CSharp broke
whenever the sibling CultLib was dirty, elsewhere, or missing. The guard now
runs only when a ProjectReference names the CultMath project under
CultLibRoot: Aetheria.Shared directly, AetherDb through the SDK's
transitive project references.

Checked: Assembly-CSharp skips the target; Aetheria.Shared still fails on a
wrong CultLibRevision, on CULTLIB_ROOT pointing at a scratch clone on another
commit, and AetherDb fails on that clone made dirty.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-14 18:00:11 +02:00
commit ee32cd4571

View file

@ -1,7 +1,7 @@
<Project>
<Target Name="VerifyCultLibRevision"
BeforeTargets="ResolveProjectReferences"
Condition="'$(SkipCultLibRevisionCheck)' != 'true'">
Condition="'$(SkipCultLibRevisionCheck)' != 'true' and '@(ProjectReference->AnyHaveMetadataValue('Identity', '$(CultLibRoot)\packages\cultmath\src\CultMath\CultMath.csproj'))' == 'true'">
<Error Condition="!Exists('$(CultLibRoot)\packages\cultmath\src\CultMath\CultMath.csproj')"
Text="CultLibRoot '$(CultLibRoot)' does not contain the required CultMath project." />
<Exec Command="&quot;$(GitExecutable)&quot; -C &quot;$(CultLibRoot)&quot; rev-parse HEAD"