Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
118 lines (96 loc) · 7.48 KB
/
Copy pathDirectory.Build.props
File metadata and controls
118 lines (96 loc) · 7.48 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<Project>
<!--
#3222: the ONE place a product version is declared. Every project in the tree inherits it by MSBuild's
automatic Directory.Build.props import, and AssemblyVersion / FileVersion / InformationalVersion derive
from it at build time. A release bump is the one line below.
The PropertyGroup comes FIRST, ahead of the rationale, and no prose above it may spell the property name
in its angle-bracket form. Two consumers read this file as TEXT and take the first match: the linux jobs
in build.yml and nightly.yml, with a grep lookbehind. A mention of the property ahead of the property
itself is what those reads return. Not hypothetical, it was written that way first, and both came back
with the word "from" out of this comment while the XML reads still returned 3.6.0. Naming artifacts is
all those reads do, so nothing goes red, the release tarball is just named wrongly.
ProductVersionDeclarationTests runs each shipped read's own pattern against this file and requires it to
agree with the XML read, so the ordering is enforced rather than remembered.
-->
<PropertyGroup>
<Version>3.13.0</Version>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
<!--
Why one declaration, and why here.
#2113 established the rule one level down and inside a single project: four hand-maintained copies of one
fact is a release-day trap. It proved that from a shipped artifact. The 3.4.0 release bumped the version
property and the binaries still STAMPED 3.3.0.0, because AssemblyVersion / FileVersion /
InformationalVersion were pinned by hand beside it. The remedy was to delete the derived properties and
let derivation happen.
The same trap had reassembled itself one level UP, across projects. Six csproj files each declared their
own version: four at 3.6.0, and the two deprecated Installer projects at 3.3.0, three releases behind.
Two consumers read two DIFFERENT files. check-version-bump.yml gated the release on
deprecated/Dashboard/Dashboard.csproj while nightly.yml named every artifact from
Lite/PerformanceMonitorLite.csproj, and nothing compared them, so bumping the file the gate read let a
release merge with every artifact still carrying the old version. The deprecated projects also still
hand-set the three derived properties #2113 deleted, which is why Dashboard's binary stamped 3.3.0.0
while its csproj said 3.6.0: the file the release gate took its judgement from produced an artifact three
releases behind.
The suffix suppression is the second half of the same fact. It keeps InformationalVersion a clean semver
rather than gaining a source-revision suffix under CI SourceLink; without it the deprecated projects'
binaries stamped 3.3.0 plus a sha even where the version was hand-pinned.
Directory.Build.props rather than a file the projects import by hand: an explicit Import is a convention a
new project can forget, which is the shape of the defect this replaces. The automatic import reaches the
test projects and the deprecated subtree as well, so all 22 projects in the tree now stamp the product
version instead of the SDK's 1.0.0 default. That is the blast radius and it is deliberate. Measured on
this change: the three shipped apps stamp 3.6.0.0 before and after, Dashboard and the two Installer
projects move 3.3.0.0 to 3.6.0.0, and the shared libraries and test assemblies move 1.0.0.0 to 3.6.0.0.
Nothing reads a library's or test assembly's own version to make a decision. UpdateCheckService reads the
ENTRY assembly, and DarlingCliCommands.ProductVersion reads the service assembly, which is a shipped
app and carries the product version either way.
-->
<!--
#6978: the warning suppressions shared by every project outside deprecated/, declared once. Each code
names what the rule flags and why this repo turns it off. A project that needs a code beyond these
appends it in its own project file with its reason, always in the form that begins with the inherited
value, because a plain assignment there would replace this whole list.
The deprecated projects each assign their own list without the inherited value, so this block does not
reach them and their suppressions are unchanged. Codes that no longer fired anywhere (CA1849, CA2007,
CA1508, CA2201, CA1852, CA1860) were removed from the old copied lists after a build with no
suppressions at all counted zero hits for them.
-->
<PropertyGroup>
<!-- CA1305: Specify IFormatProvider. Log text, diagnostics and test output are formatted with the current culture on purpose and are not user-facing. -->
<NoWarn>$(NoWarn);CA1305</NoWarn>
<!-- CA1507: Use nameof instead of a string literal. Literal names in messages, binding paths and test data are kept as written. -->
<NoWarn>$(NoWarn);CA1507</NoWarn>
<!-- CA1510: Use ArgumentNullException.ThrowIfNull. The explicit null check and throw is kept; the helper is a style choice, not a fix. -->
<NoWarn>$(NoWarn);CA1510</NoWarn>
<!-- CA1707: No underscores in identifiers. Test methods are named Subject_Condition_Result. -->
<NoWarn>$(NoWarn);CA1707</NoWarn>
<!-- CA1805: Do not initialize a field to its default value. An explicit default (= false, = 0, = null) is kept where it documents intent. -->
<NoWarn>$(NoWarn);CA1805</NoWarn>
<!-- CA1806: Do not ignore a method result. Best-effort calls whose result is deliberately unused are written as plain statements. -->
<NoWarn>$(NoWarn);CA1806</NoWarn>
<!-- CA1816: Call GC.SuppressFinalize in Dispose. The types have no finalizer, so the call would do nothing. -->
<NoWarn>$(NoWarn);CA1816</NoWarn>
<!-- CA1822: Member can be static. Instance members stay instance members for interface shape, dependency injection, WPF handlers and stable call sites. -->
<NoWarn>$(NoWarn);CA1822</NoWarn>
<!-- CA1845: Use span-based string.Concat. A micro-allocation tweak that costs readability and is not worth it off a hot path. -->
<NoWarn>$(NoWarn);CA1845</NoWarn>
<!-- CA1848: Use LoggerMessage delegates. Logging goes through the plain ILogger extension methods; no logging call sits on a hot path. -->
<NoWarn>$(NoWarn);CA1848</NoWarn>
<!-- CA1861: Avoid constant arrays as arguments. Inline array literals (parameter lists, test data) run once per call and are clearer than hoisted fields. -->
<NoWarn>$(NoWarn);CA1861</NoWarn>
<!-- CA2254: The logging message template should not vary between calls. Interpolated log messages are kept for readable single-line output. -->
<NoWarn>$(NoWarn);CA2254</NoWarn>
</PropertyGroup>
<!--
#7065: a warning fails the build of every project outside deprecated/, product and test alike, so a new one
cannot sit unnoticed. Before this the gate lived only in the two test projects, and a product warning
(CA1068 in a Darling storage file) reached CI as nothing more than a count in a build log. The suppressions
above are the only rules held back. The NuGet audit codes (NU1901 to NU1904) stay warnings: an advisory
published against a package we already use would otherwise turn every build red on a day nothing in the
repo changed. A project that cannot meet the gate says why in its own project file.
-->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project>