c904472af2
v2-ci / unit-tests (push) Has been cancelled
Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
52 lines
2.9 KiB
XML
52 lines
2.9 KiB
XML
<Project>
|
|
<!--
|
|
Defaults inherited by every csproj. Individual projects may override.
|
|
|
|
TreatWarningsAsErrors is ON for every project, src/ and tests alike (#766 ratchet). The solution builds with
|
|
0 warnings since #725 (xUnit1051 etc. cleaned), so any new warning, including analyzer ones, now fails the
|
|
build instead of accumulating. The 61 src/ projects also still set it in their own csproj (#606); that is
|
|
redundant but harmless. A project that genuinely needs an exception should suppress the specific warning
|
|
via NoWarn, not turn this off.
|
|
-->
|
|
<PropertyGroup>
|
|
<TargetFramework>net10.0</TargetFramework>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<LangVersion>latest</LangVersion>
|
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
</PropertyGroup>
|
|
|
|
<!--
|
|
OTOPCUA0001 is an ERROR under src/ (#595): production code must route capability calls through
|
|
CapabilityInvoker. src/ is currently clean; test projects keep it a Warning and suppress it
|
|
per-csproj where they call drivers at the wire level. The path test is relative to this file
|
|
so it does not depend on where the repo is checked out; backslashes normalised for Windows.
|
|
-->
|
|
<PropertyGroup>
|
|
<_OtRepoRoot>$([System.String]::Copy('$(MSBuildThisFileDirectory)').Replace('\','/'))</_OtRepoRoot>
|
|
<_OtProjPath>$([System.String]::Copy('$(MSBuildProjectFullPath)').Replace('\','/'))</_OtProjPath>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="$(_OtProjPath.StartsWith('$(_OtRepoRoot)src/'))">
|
|
<WarningsAsErrors>$(WarningsAsErrors);OTOPCUA0001</WarningsAsErrors>
|
|
</PropertyGroup>
|
|
|
|
<!--
|
|
Wire the custom OTOPCUA0001 analyzer (UnwrappedCapabilityCallAnalyzer) into every project so
|
|
the CapabilityInvoker-wrapping rule is enforced tree-wide, not just against the analyzer's own
|
|
unit tests (arch-review 07/C-1 — the "built-but-never-wired" failure mode). Analyzer projects
|
|
target netstandard2.0 and are loaded into the compiler host, so OutputItemType="Analyzer" +
|
|
ReferenceOutputAssembly="false" is the correct incantation (the DLL is not linked). Excluded
|
|
from the analyzer project itself (self-reference cycle) and its test project (which already
|
|
references the analyzer directly). OTOPCUA0001 defaults to Warning; projects with genuine
|
|
intentional unwrapped calls (unit tests exercising drivers at the wire level, the invoker's own
|
|
internals) carry a scoped NoWarn / pragma — see the per-project suppressions.
|
|
-->
|
|
<ItemGroup Condition="'$(MSBuildProjectName)' != 'ZB.MOM.WW.OtOpcUa.Analyzers'
|
|
and '$(MSBuildProjectName)' != 'ZB.MOM.WW.OtOpcUa.Analyzers.Tests'">
|
|
<ProjectReference Include="$(MSBuildThisFileDirectory)src/Tooling/ZB.MOM.WW.OtOpcUa.Analyzers/ZB.MOM.WW.OtOpcUa.Analyzers.csproj"
|
|
OutputItemType="Analyzer"
|
|
ReferenceOutputAssembly="false"
|
|
PrivateAssets="all" />
|
|
</ItemGroup>
|
|
</Project>
|