-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAllProjects.proj.xml
More file actions
189 lines (165 loc) · 10.1 KB
/
AllProjects.proj.xml
File metadata and controls
189 lines (165 loc) · 10.1 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
<!-- MikeNakis.Commonfiles/AllProjects.proj.xml -->
<Project>
<PropertyGroup>
<ImplicitUsings>Disable</ImplicitUsings>
<Nullable>Enable</Nullable>
<DebugSymbols>True</DebugSymbols>
<!-- Under the "legacy project system", project references were _not_ transitive. When Sdk-style projects were
introduced, project references became transitive. This is retarded: project references should _not_ be
transitive because the availability of a certain project should not depend on whether it is referenced or
not by another project that we reference, which is a private implementation detail of the other project. -->
<DisableTransitiveProjectReferences>True</DisableTransitiveProjectReferences>
<!-- The following magical incantation is necessary for the build acceleration magic to work.
In Visual Studio, if you go to Options -> Projects and Solutions -> SDK Style Projects -> Up to Date Checks
and make sure that:
- "Don't call MSBuild if a project appears to be up to date" is checked
- "Logging Level" is set to "Minimal" (or above)
...and then try to build, the following message will be emitted once for each project:
"FastUpToDate: This project has enabled build acceleration, but not all referenced projects produce a
reference assembly. Ensure projects producing the following outputs have the 'ProduceReferenceAssembly'
MSBuild property set to 'true': [list-of-projects] See https://aka.ms/vs-build-acceleration for more
information. ([name-of-project])"
So, the following magical incantation is necessary to avoid this message. -->
<ProduceReferenceAssembly>True</ProduceReferenceAssembly>
<!-- TODO: research this! -->
<IsTestingPlatformApplication>False</IsTestingPlatformApplication>
<!-- TODO: research this! -->
<!-- ManagePackageVersionsCentrally>True</ManagePackageVersionsCentrally -->
<!-- TODO: research this! -->
<!--<EnableMSTestRunner>True</EnableMSTestRunner>-->
<!-- CS0809: "Obsolete member overrides non-obsolete member" -->
<NoWarn>$(NoWarn);CS0809</NoWarn>
<!-- Justification: It is perfectly fine for an obsolete member to override a non-obsolete member. We do so
intentionally all over the place. This warning is junk. -->
<!-- PEARL: The DefineDebug and DefineTrace magical incantations are mentioned by official documentation but
have absolutely no effect. A more meticulous search though the apocryphal sriptures reveals that the
DisableImplicitConfigurationDefines and DisableDiagnosticTracing magical incantations must be used instead.
(See below.) -->
<DefineDebug>False</DefineDebug>
<DefineTrace>False</DefineTrace>
<!-- PEARL: The DisableImplicitConfigurationDefines and DisableDiagnosticTracing magical incantations are
necessary to prevent 'DEBUG' and 'TRACE' from being automagically predefined. -->
<DisableImplicitConfigurationDefines>True</DisableImplicitConfigurationDefines>
<DisableDiagnosticTracing>True</DisableDiagnosticTracing>
<!-- This enables some extra build-time checking of MSBuild project files. It is very half-assed but they might
improve it over time. -->
<MSBuildCheck>True</MSBuildCheck>
<!-- PEARL: PathMap cannot be used for anything but the release build, because if you set it to anything other
than the following then all debugging breaks, and even if you set it to the following, edit-and-continue breaks. -->
<!--<PathMap Condition="'$(NoPathMap)' != 'True'">$(MSBuildProjectDirectory)=.\..\$(MSBuildProjectName)</PathMap>-->
<!-- PEARL: MSBuild will automagically append a pile of garbage (a git commit hash) to the assembly
informational version attribute in the auto-generated AssemblyInfo.cs. The following magical incantation is
necessary to prevent this from happening. Found here: https://stackoverflow.com/a/77051386/773113. -->
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>
<Choose>
<When Condition="'$(Configuration)' == 'Debug'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);DEBUG;PRECONDITIONS;ASSERTIONS</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<Optimize>False</Optimize>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<PackagesConfiguration>Develop</PackagesConfiguration>
<DebugType>Full</DebugType>
</PropertyGroup>
</When>
<When Condition="'$(Configuration)' == 'Optimized'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);DEBUG;PRECONDITIONS;ASSERTIONS</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<Optimize>True</Optimize>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<PackagesConfiguration>Develop</PackagesConfiguration>
<DebugType>Full</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
</When>
<When Condition="'$(Configuration)' == 'Develop'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);DEBUG;PRECONDITIONS</DefineConstants>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<Optimize>True</Optimize>
<EnableNETAnalyzers>False</EnableNETAnalyzers>
<PackagesConfiguration>Develop</PackagesConfiguration>
<DebugType>Portable</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
</PropertyGroup>
</When>
<When Condition="'$(Configuration)' == 'Release'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<Optimize>True</Optimize>
<EnableNETAnalyzers>False</EnableNETAnalyzers>
<PackagesConfiguration>Release</PackagesConfiguration>
<DebugType>Portable</DebugType>
<Deterministic>True</Deterministic>
<!-- This property acts like PathMap replacing $(MSBuildProjectDirectory) with '/_/', thus removing
from source paths information that depends on the machine that the code was compiled in. -->
<!-- PEARL: DeterministicSourcePaths can only be used on release builds, because it breaks
edit-and-continue. (Strangely enough, if used on a debug build, breakpoints still work.) -->
<!-- PEARL: This property is UNDOCUMENTED. -->
<DeterministicSourcePaths>True</DeterministicSourcePaths>
</PropertyGroup>
</When>
<Otherwise>
<!-- PEARL: MSBuild does not allow an <Error> here, nor a <Task> with an <Error>, so, screw you MSBuild, this will do it. -->
<ItemGroup>
<PackageReference Include="=== Invalid configuration: '$(Configuration)' ===" Version="1.0.1" />
</ItemGroup>
</Otherwise>
</Choose>
<!--<Target Name="PrintStuff1" BeforeTargets="Compile">
<Message Importance="High" Text="TargetFramework: '$(TargetFramework)'; TargetPlatform: '$(TargetPlatform)'; RuntimeIdentifier: '$(RuntimeIdentifier)'" />
</Target>-->
<Target Name="PrintStuff2" BeforeTargets="CoreCompile">
<Message Importance="High" Text="Configuration: '$(Configuration)'; IsTestProject: '$(IsTestProject)'; DefineConstants: '$(DefineConstants)'" />
</Target>
<PropertyGroup Condition="'$(EnableNETAnalyzers)' == 'True'">
<AnalysisLevel>latest-Recommended</AnalysisLevel>
<RunAnalyzersDuringBuild>True</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>True</RunAnalyzersDuringLiveAnalysis>
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<WarningLevel>9999</WarningLevel>
<!-- PEARL: Microsoft's understanding of the "treat warnings as errors" concept involves the promotion of every
single warning into an actual error.
A much more reasonable approach would have been to simply generate a single error at the end of the build,
if there were any warnings during the build. Alas, that would have made too much sense.
So, if TreatWarningsAsErrors is set to True, then any .editorconfig rules whose severity is explicitly set
to "warning" will instead appear as errors. (What kind of idiot designed this?)
You can set CodeAnalysisTreatWarningsAsErrors to False, but then you forfeit the "treat warnings as errors"
functionality for code analysis rules, and besides, this will only affect code analysis rules (CAxxxx); it
will not affect formatting rule violations (IDExxxx) which will still appear as errors.
(What kind of full-retard designed this?) -->
<!--<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>False</CodeAnalysisTreatWarningsAsErrors>-->
<!-- PEARL: The following magical incantation is necessary or else we get the following warning:
"CSC : warning EnableGenerateDocumentationFile: Set MSBuild property 'GenerateDocumentationFile'
to 'true' in project file to enable IDE0005 (Remove unnecessary usings/imports) on build" -->
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup Condition="'$(EnableNETAnalyzers)' == 'True'">
<!-- PEARL: if a globalconfig file is not found, we get silent failure. -->
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)\AllCode.globalconfig" />
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)\ProductionCode.globalconfig" Condition="'$(IsTestProject)' != 'True'" />
<GlobalAnalyzerConfigFiles Include="$(MSBuildThisFileDirectory)\TestCode.globalconfig" Condition="'$(IsTestProject)' == 'True'" />
</ItemGroup>
<!-- https://github.com/coverlet-coverage/coverlet -->
<ItemGroup Condition="'$(Configuration)' == 'Debug' AND '$(IsTestProject)' == 'True'">
<PackageReference Include="coverlet.collector" Version="6.0.4"/>
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'True'">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.6.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.2" />
</ItemGroup>
<Target Name="VersioningTarget">
<Exec Command="bash ../get_version.bash" ConsoleToMsBuild="True" StandardOutputImportance="Low">
<Output TaskParameter="ConsoleOutput" PropertyName="Version" />
</Exec>
<Message Importance="High" Text="$(MSBuildProjectName) version: '$(Version)'" />
<PropertyGroup>
<PackageVersion>$(Version)</PackageVersion>
</PropertyGroup>
</Target>
</Project>