build: Directory.Build.props for centralised SAMVersion stamping#4
Conversation
Mirrors SAM-BIM/SAM#7. Stage 2 of the AssemblyVersion versioning migration.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acf2a39986
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # .NET AssemblyVersion components are UInt16 (max 65535). Cap to 60000 for headroom. | ||
| $run = ${{ github.run_number }} % 60000 | ||
| if ($ref -match 'sow/(\d{4})-Q(\d)') { | ||
| $v = "$($Matches[1]).$($Matches[2]).$run" |
There was a problem hiding this comment.
Emit four-part SAMVersion for file version stamping
SAMVersion is later written into AssemblyFileVersionAttribute by Directory.Build.props (_GenerateSAMVersionFile), but both assignments here produce a 3-part value (YYYY.Q.run). AssemblyFileVersion expects a 4-part dotted version; with 3 parts the compiler emits a warning and Windows file properties can show unpredictable results, and this can become a hard CI failure in builds that treat warnings as errors. Please append a revision component (for example .0) in both code paths.
Useful? React with 👍 / 👎.
PowerShell 5.1 doesn't support backtick-u escape sequences; the
apply-stage2.ps1 script leaked them as literal text in 'Copyright (c) 2020u{2013}2026'.
Codex P1 on SAM_LadybugTools#4: classic (non-SDK) csprojs don't set GenerateAssemblyInfo at all, so the previous '== false' condition skipped them. Switching to '!= true' catches both GenerateAssemblyInfo=false (SDK projects with legacy AssemblyInfo.cs) AND empty (classic projects).
- Append .0 so SAMVersion is 4-part (AssemblyFileVersion expects 4 parts). - Prefer github.head_ref when it matches sow/yyyy-Qx (release-promotion PRs). - Mirrors SAM sow/2026-Q2 6d87d98e.
|
Thanks @codex — fixed in the P2 sweep. SAMVersion is now |
|
To use Codex here, create an environment for this repo. |
Mirrors SAM-BIM/SAM#7. Stage 2.