build: scoped OTOPCUA0001 NoWarn in 13 test projects, error under src/, pin SDK via global.json (#595 #606)
Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
+18
-6
@@ -2,12 +2,10 @@
|
|||||||
<!--
|
<!--
|
||||||
Defaults inherited by every csproj. Individual projects may override.
|
Defaults inherited by every csproj. Individual projects may override.
|
||||||
|
|
||||||
Deviation from the original v2 plan: TreatWarningsAsErrors is NOT set globally because the
|
TreatWarningsAsErrors is NOT set globally because test projects carry analyzer warnings
|
||||||
pre-v2 test projects (e.g. Admin.Tests) carry 240+ xUnit1051 analyzer warnings that would
|
(e.g. xUnit1051) that would fail the build. src/ projects opt in to
|
||||||
fail the build. New v2 projects (Commons, Cluster, ControlPlane, Runtime, OpcUaServer, AdminUI,
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> in their own csproj (a few still pending;
|
||||||
Host, Security) MUST opt in to <TreatWarningsAsErrors>true</TreatWarningsAsErrors> in their
|
see #606). Once every project is clean this can be promoted back to a global default.
|
||||||
own csproj. Once the legacy Admin/Server projects are deleted (Phase 10, Task 56), this can
|
|
||||||
be promoted back to a global default.
|
|
||||||
-->
|
-->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
@@ -16,6 +14,20 @@
|
|||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</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
|
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
|
the CapabilityInvoker-wrapping rule is enforced tree-wide, not just against the analyzer's own
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "10.0.100",
|
||||||
|
"rollForward": "latestFeature"
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.IntegrationTests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.IntegrationTests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Calculation.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Calculation.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.FOCAS.IntegrationTests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.FOCAS.IntegrationTests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.FOCAS.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Galaxy.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Modbus.IntegrationTests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Modbus.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Modbus.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.Mqtt.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.IntegrationTests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.IntegrationTests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.IntegrationTests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.IntegrationTests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
+6
@@ -9,6 +9,12 @@
|
|||||||
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Tests</RootNamespace>
|
<RootNamespace>ZB.MOM.WW.OtOpcUa.Driver.TwinCAT.Tests</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!-- OTOPCUA0001 (#595): these suites call driver capabilities directly at the wire level on purpose;
|
||||||
|
the CapabilityInvoker-wrapping rule applies to production code only (src/ fails the build on it). -->
|
||||||
|
<PropertyGroup>
|
||||||
|
<NoWarn>$(NoWarn);OTOPCUA0001</NoWarn>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="xunit.v3"/>
|
<PackageReference Include="xunit.v3"/>
|
||||||
<PackageReference Include="Shouldly"/>
|
<PackageReference Include="Shouldly"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user