Repository navigation
Expand file tree
/
Copy pathDirectory.Build.props
More file actions
168 lines (152 loc) · 11.2 KB
/
Copy pathDirectory.Build.props
File metadata and controls
168 lines (152 loc) · 11.2 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
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Import repository path definitions -->
<Import Project="$(MSBuildThisFileDirectory)msbuild/repository.props" />
<!-- Composed platform package IDs (sourceName-safe; see timewarp-platform-packages.props) -->
<Import Project="$(MSBuildThisFileDirectory)msbuild/timewarp-platform-packages.props"
Condition="'$(_TwPlatformPackagesPropsImported)' != 'true'" />
<!-- Platform distribution switches (tasks 051/092/115): ProjectReference when the source tree is
present (this repo dogfoods), PackageReference when the template excluded it (generated
apps). Detection lives at ROOT (not source/Directory.Build.props) because tests/ projects
need the switches too — tests/common/timewarp-testing references identity dual-mode
(task 124) and the source-tree props never reach the tests tree. Force with
-p:UseFoundationPackages= / -p:UseAnalyzerPackages= / -p:UseIdentityPackages=. -->
<PropertyGroup Label="Platform Distribution Switches">
<UseFoundationPackages Condition="'$(UseFoundationPackages)' == '' and !Exists('$(MSBuildThisFileDirectory)source/foundation/foundation-domain/foundation-domain.csproj')">true</UseFoundationPackages>
<UseFoundationPackages Condition="'$(UseFoundationPackages)' == ''">false</UseFoundationPackages>
<UseAnalyzerPackages Condition="'$(UseAnalyzerPackages)' == '' and !Exists('$(MSBuildThisFileDirectory)source/analyzers/timewarp-architecture-convention-analyzers/timewarp-architecture-convention-analyzers.csproj')">true</UseAnalyzerPackages>
<UseAnalyzerPackages Condition="'$(UseAnalyzerPackages)' == ''">false</UseAnalyzerPackages>
<UseIdentityPackages Condition="'$(UseIdentityPackages)' == '' and !Exists('$(MSBuildThisFileDirectory)source/libraries/timewarp-identity/timewarp-identity.csproj')">true</UseIdentityPackages>
<UseIdentityPackages Condition="'$(UseIdentityPackages)' == ''">false</UseIdentityPackages>
<UseX402Packages Condition="'$(UseX402Packages)' == '' and !Exists('$(MSBuildThisFileDirectory)source/libraries/timewarp-402/timewarp-402.csproj')">true</UseX402Packages>
<UseX402Packages Condition="'$(UseX402Packages)' == ''">false</UseX402Packages>
</PropertyGroup>
<!-- MSBuild and NuGet behavior configuration -->
<PropertyGroup Label="MSBuild/NuGet Configuration">
<!-- Output packages to our local feed directory -->
<PackageOutputPath>$(PackagesDirectory)</PackageOutputPath>
<!-- Suppress .NET preview SDK message -->
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
<!-- Default language and framework settings for all projects -->
<PropertyGroup Label="Project Defaults">
<!-- Package <Version> lives in source/Directory.Build.props (TimeWarp convention + dev check-version). -->
<TargetFramework>net11.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<!-- Source generator debugging: emit generated files to artifacts directory -->
<PropertyGroup Label="Source Generator Output">
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(ArtifactsDirectory)generated/$(MSBuildProjectName)</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<!-- Exclude emitted generated files from compilation (already included by source generator) -->
<ItemGroup Label="Source Generator Output">
<Compile Remove="$(CompilerGeneratedFilesOutputPath)/**/*.cs" />
</ItemGroup>
<!-- C# Interceptors (for source generators) -->
<PropertyGroup Label="Interceptors">
<!-- Enable interceptors in the TimeWarp.Nuru.Generated namespace -->
<!-- Note: Property name changed from InterceptorsPreviewNamespaces to InterceptorsNamespaces in .NET 10 -->
<InterceptorsNamespaces>$(InterceptorsNamespaces);TimeWarp.Nuru.Generated</InterceptorsNamespaces>
</PropertyGroup>
<!-- Code quality, analyzers, and warning configuration -->
<PropertyGroup Label="Code Quality and Analysis">
<!-- Treat all warnings as errors -->
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<WarningLevel>5</WarningLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>All</AnalysisMode>
<AnalysisLevel>latest-all</AnalysisLevel>
<!-- Report analyzer diagnostics in build output -->
<ReportAnalyzer>true</ReportAnalyzer>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<!-- IDE0005 (unnecessary usings) at warning severity requires a documentation file during
build (Roslyn #41640 / EnableGenerateDocumentationFile). We emit the file.
CS1591 (missing XML on publicly visible members), task 177:
packable (IsPackable=true) — warning, and TreatWarningsAsErrors fails the build so
published NuGet surface stays documented;
template/app/tests — stay in NoWarn (Purpose/Design regions are the agent SSOT).
Other XML-doc ids (broken cref/param tags) stay suppressed — do not re-enable
RCS1141/1228 (empty-shell generators). The CS1591 add-to-NoWarn is applied in
Directory.Build.targets (PackableXmlDocs) because child props/csproj flip IsPackable
after this file runs. Task 170 originally suppressed CS1591 everywhere. -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Suppress specific warnings -->
<!-- CA1014: CLS compliance not required for this library -->
<!-- CA1716: Reserved keywords (matching System.Console API: In, Error) -->
<!-- CA1724: Type name conflicts (acceptable in this context) -->
<!-- CA1812: False positives for DI-instantiated classes -->
<!-- IL2026, IL2067, IL2070, IL2075, IL3050, IL2104, IL3053: AOT warnings (not yet implemented) -->
<!-- XML-doc noise once GenerateDocumentationFile is on for IDE0005 (Roslyn #41640):
broken cref/param tags are not house style gates. CS1591 is omitted here and
added only when IsPackable != true (see PackableXmlDocs in Directory.Build.targets). -->
<NoWarn>$(NoWarn);CA1014;CA1716;CA1724;CA1812;IL2026;IL2067;IL2070;IL2075;IL3050;IL2104;IL3053;1570;1571;1572;1573;1574;1580;1581;1584;1587;1589;1590;1592;1710;1711;1712;1734;0419</NoWarn>
</PropertyGroup>
<!-- Code analyzers applied to all projects -->
<ItemGroup Label="Code Analyzers">
<PackageReference Include="Roslynator.Analyzers" PrivateAssets="all" />
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Roslynator.Formatting.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="all" />
<!-- Prefer project global-usings.cs over file-level usings (editorconfig GlobalUsingsAnalyzer000*). Task 172. -->
<PackageReference Include="GlobalUsingsAnalyzer" PrivateAssets="all" />
<!-- TW0001 kebab-case .cs basenames (TimeWarp.SourceGenerators; multi-dot partials since beta.9).
TW0007 file-level usings (filename in .editorconfig; diagnostic stays package-default off).
TWA0004, TWA0023, and TWA0038 are the generic style rules in this package since 1.0.0-beta.13.
TWA0004 and TWA0038 warn and are enabled. TWA0023 warns and is disabled.
Severity: .editorconfig dotnet_diagnostic.TW0001 — default off in the package. -->
<PackageReference Include="TimeWarp.SourceGenerators" PrivateAssets="all" />
</ItemGroup>
<!-- Repo convention analyzers (TWA*): the one wiring, shared by source/, tests/, and tools/ (task 470).
Each of those trees opts in by setting EnableConventionAnalyzers to true in its own
Directory.Build.props. MSBuild evaluates every property before any item, so a property a child
props sets is in force for these item conditions. Projects outside those trees (kanban research
runfiles, timewarp-templates, eval fixtures) do not opt in and do not load the rules.
Two forms, picked by UseAnalyzerPackages above: a ProjectReference to source/analyzers in the
monorepo, and the platform Analyzers package in a generated app, where source/analyzers is not
shipped. The package ID is composed (task 115) so the template sourceName cannot rewrite it.
The wiring sits here, not in an imported msbuild/ file, because the ganda cpm-consistency audit
finds PackageReference items only in Directory.Build.props and *.csproj files.
Rules that are off for a tree belong in that tree's props or in .editorconfig, not here. -->
<!-- Task 487: MTP code coverage extension for test projects (tests/Directory.Build.props sets
CollectTestCoverage). `dev test` turns collection on with the MTP coverage flag; the extension ships in the template. -->
<ItemGroup Label="Code Coverage" Condition="'$(CollectTestCoverage)' == 'true'">
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
</ItemGroup>
<ItemGroup Label="Convention Analyzers"
Condition="'$(EnableConventionAnalyzers)' == 'true' and '$(UseAnalyzerPackages)' != 'true' and '$(MSBuildProjectName)' != 'timewarp-architecture-convention-analyzers'">
<ProjectReference Include="$(MSBuildThisFileDirectory)source/analyzers/timewarp-architecture-convention-analyzers/timewarp-architecture-convention-analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false"
IsAspireProjectResource="false" />
</ItemGroup>
<ItemGroup Label="Convention Analyzers"
Condition="'$(EnableConventionAnalyzers)' == 'true' and '$(UseAnalyzerPackages)' == 'true'">
<PackageReference Include="$(TwArchitectureAnalyzersPackageId)" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Label="Convention Analyzer Inputs" Condition="'$(EnableConventionAnalyzers)' == 'true'">
<!-- TWA0009 reads build_property.TimeWarpSliceRoot for an optional SliceRoot override.
Custom properties are not analyzer-visible unless listed (RootNamespace is SDK-visible). -->
<CompilerVisibleProperty Include="TimeWarpSliceRoot" />
<!-- TWA0022 gates on the Blazor WASM SDK's own property to identify SPA client compilations. -->
<CompilerVisibleProperty Include="UsingMicrosoftNETSdkBlazorWebAssembly" />
</ItemGroup>
<!-- template.json feeds TWA0010 (template-flag directives must have matching DefineConstants).
Absent in generated apps, where the analyzer is silent. -->
<ItemGroup Label="Convention Analyzer Inputs"
Condition="'$(EnableConventionAnalyzers)' == 'true' and Exists('$(MSBuildThisFileDirectory).template.config/template.json')">
<AdditionalFiles Include="$(MSBuildThisFileDirectory).template.config/template.json" />
</ItemGroup>
<!-- Banned API enforcement -->
<ItemGroup Label="Banned API Files">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" />
</ItemGroup>
<ItemGroup Label="Build Tasks">
<PackageReference Include="TimeWarp.Build.Tasks" PrivateAssets="all" />
</ItemGroup>
</Project>