Aetheria/Directory.Build.targets
Meta Vens e91ba36976 Pin CultLib per package, as Unity's manifest does
The headless build pinned one CultLib revision for every package. CultMath
0.2.4 needs a newer revision than CultCache's, and bumping the single pin
would have compiled six commits of newer CultCache under the headless tests
while Unity stays on caching-unity-v1.4.0. CultMathRoot/CultMathRevision now
pin CultMath at the 0.2.4 tag; CultLibRoot/CultLibRevision keep CultCache at
45c2f40. Verified: 244 pass with both roots right, and each wrong root is
refused by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-24 19:17:40 +02:00

39 lines
2.4 KiB
XML

<Project>
<!-- One pin per CultLib package, mirroring Packages/manifest.json, which pins each Unity package at its
own tag. The headless build must compile the same revisions Unity consumes, so a package moves
here only when its manifest tag moves. -->
<ItemGroup>
<PinnedCultLib Include="CultMath"
Root="$(CultMathRoot)"
Revision="$(CultMathRevision)"
Project="packages\cultmath\src\CultMath\CultMath.csproj"
RootProperty="CultMathRoot" />
<PinnedCultLib Include="CultCache"
Root="$(CultLibRoot)"
Revision="$(CultLibRevision)"
Project="src\GameCult.Caching\GameCult.Caching.csproj"
RootProperty="CultLibRoot" />
</ItemGroup>
<Target Name="VerifyCultLibRevision"
BeforeTargets="ResolveProjectReferences"
Outputs="%(PinnedCultLib.Identity)"
Condition="'$(SkipCultLibRevisionCheck)' != 'true' and '@(ProjectReference->AnyHaveMetadataValue('Identity', '$(CultMathRoot)\packages\cultmath\src\CultMath\CultMath.csproj'))' == 'true'">
<Error Condition="!Exists('%(PinnedCultLib.Root)\%(PinnedCultLib.Project)')"
Text="%(PinnedCultLib.RootProperty) '%(PinnedCultLib.Root)' does not contain %(PinnedCultLib.Project)." />
<Exec Command="&quot;$(GitExecutable)&quot; -C &quot;%(PinnedCultLib.Root)&quot; rev-parse HEAD"
ConsoleToMSBuild="true"
StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="ActualPinnedRevision" />
</Exec>
<Error Condition="'$([System.String]::Copy($(ActualPinnedRevision)).Trim())' != '%(PinnedCultLib.Revision)'"
Text="%(PinnedCultLib.Identity) must be CultLib revision %(PinnedCultLib.Revision); found $([System.String]::Copy($(ActualPinnedRevision)).Trim()). Set %(PinnedCultLib.RootProperty) to the admitted clean worktree." />
<Exec Command="&quot;$(GitExecutable)&quot; -C &quot;%(PinnedCultLib.Root)&quot; status --porcelain --untracked-files=normal"
ConsoleToMSBuild="true"
StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="PinnedStatus" />
</Exec>
<Error Condition="'$([System.String]::Copy($(PinnedStatus)).Trim())' != ''"
Text="%(PinnedCultLib.RootProperty) must be clean before Aetheria consumes it." />
</Target>
</Project>