Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
58 lines (52 loc) · 3.25 KB
/
Copy pathDirectory.Build.props
File metadata and controls
58 lines (52 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<Project>
<!--
Versioning: base is 1.0 (bump VersionPrefix by hand for real milestones). The patch number is
the git commit count, so it auto-bumps on every check-in; the informational version also carries
the short commit SHA so a user's reported version pins the exact commit. Falls back to
1.0.0+nogit when git isn't available (e.g. a source drop), so builds never fail on this.
AssemblyVersion stays 1.0.0.0 (stable, so assembly binding doesn't churn per commit).
FileVersion / InformationalVersion carry the real number for the .exe properties and the logs.
-->
<PropertyGroup>
<Company>RelentlessOldMan</Company>
<Product>CodeCompass</Product>
<VersionPrefix>1.0</VersionPrefix>
<CCGitCount>0</CCGitCount>
<CCGitSha>nogit</CCGitSha>
<!-- We already put the short SHA into InformationalVersion ourselves; stop the SDK from also
appending the full commit SHA (yields an ugly "1.0.52+short.full" double-SHA). -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<!-- Pin the full transitive dependency graph in a committed packages.lock.json per project. Without it,
floating (>=) transitive versions can drift on any restore with no code change and no diff - exactly
how a net10-only System.Text.Json silently replaced the net8-compatible one and broke the published
MCP server between releases. With lockfiles, every restore uses the locked versions and any real graph
change is a reviewable diff. The release gate restores in locked mode so drift is a hard failure. -->
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<!-- The build is warning-free; keep it that way. Nullable is on everywhere, so a new possible-null dereference
is a build break here rather than a field NullReferenceException later. -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<Target Name="CCStampVersion"
BeforeTargets="GetAssemblyVersion;GenerateAssemblyInfo"
Condition="'$(CCStamped)' != 'true'">
<Exec Command="git rev-list --count HEAD" ConsoleToMSBuild="true" ContinueOnError="true"
StandardOutputImportance="low" StandardErrorImportance="low">
<Output TaskParameter="ConsoleOutput" PropertyName="_CCCount" />
<Output TaskParameter="ExitCode" PropertyName="_CCCountRc" />
</Exec>
<Exec Command="git rev-parse --short=8 HEAD" ConsoleToMSBuild="true" ContinueOnError="true"
StandardOutputImportance="low" StandardErrorImportance="low">
<Output TaskParameter="ConsoleOutput" PropertyName="_CCSha" />
<Output TaskParameter="ExitCode" PropertyName="_CCShaRc" />
</Exec>
<PropertyGroup>
<CCGitCount Condition="'$(_CCCountRc)' == '0' and '$(_CCCount)' != ''">$(_CCCount)</CCGitCount>
<CCGitSha Condition="'$(_CCShaRc)' == '0' and '$(_CCSha)' != ''">$(_CCSha)</CCGitSha>
<Version>$(VersionPrefix).$(CCGitCount)</Version>
<AssemblyVersion>$(VersionPrefix).0.0</AssemblyVersion>
<FileVersion>$(VersionPrefix).$(CCGitCount).0</FileVersion>
<InformationalVersion>$(VersionPrefix).$(CCGitCount)+$(CCGitSha)</InformationalVersion>
<CCStamped>true</CCStamped>
</PropertyGroup>
</Target>
</Project>