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>
22 lines
1.5 KiB
XML
22 lines
1.5 KiB
XML
<Project>
|
|
<Target Name="VerifyCultLibRevision"
|
|
BeforeTargets="ResolveProjectReferences"
|
|
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=""$(GitExecutable)" -C "$(CultLibRoot)" rev-parse HEAD"
|
|
ConsoleToMSBuild="true"
|
|
StandardOutputImportance="Low">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="ActualCultLibRevision" />
|
|
</Exec>
|
|
<Error Condition="'$([System.String]::Copy($(ActualCultLibRevision)).Trim())' != '$(CultLibRevision)'"
|
|
Text="CultLib must be revision $(CultLibRevision); found $([System.String]::Copy($(ActualCultLibRevision)).Trim()). Set CultLibRoot to the admitted clean worktree." />
|
|
<Exec Command=""$(GitExecutable)" -C "$(CultLibRoot)" status --porcelain --untracked-files=normal"
|
|
ConsoleToMSBuild="true"
|
|
StandardOutputImportance="Low">
|
|
<Output TaskParameter="ConsoleOutput" PropertyName="CultLibStatus" />
|
|
</Exec>
|
|
<Error Condition="'$([System.String]::Copy($(CultLibStatus)).Trim())' != ''"
|
|
Text="CultLibRoot must be clean before Aetheria consumes it." />
|
|
</Target>
|
|
</Project>
|