Skip to content

Commit

Permalink
refs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Jan 30, 2024
1 parent ca0835d commit 904f2c4
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 27 deletions.
44 changes: 43 additions & 1 deletion Integration/SampleTargetTests/FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,49 @@
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="NullGuard" minOccurs="0" maxOccurs="1" type="xs:anyType" />
<xs:element name="NullGuard" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="IncludeDebugAssert" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control whether asserts are added into debug builds or not.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Mode">
<xs:annotation>
<xs:documentation>The operation mode of NullGuard.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AutoDetect">
<xs:annotation>
<xs:documentation>Automatically detect the mode by the usage of JetBrains.Annotations.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Implicit">
<xs:annotation>
<xs:documentation>In implicit mode everything is assumed to be not-null, unless attributed with [AllowNull].</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Explicit">
<xs:annotation>
<xs:documentation>In explicit mode everything is assumed to be nullable, unless attributed with [NotNull].</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NullableReferenceTypes">
<xs:annotation>
<xs:documentation>Use C# 8 nullable reference type annotations.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ExcludeRegex" type="xs:string">
<xs:annotation>
<xs:documentation>A regular expression to specify the names of a classes to exclude from NullGuard.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="JetBrainsAnnotations" minOccurs="0" maxOccurs="1" type="xs:anyType" />
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
Expand Down
10 changes: 5 additions & 5 deletions Integration/SampleTargetTests/SampleTargetTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" PrivateAssets="all" />
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="SampleWeaver.Fody" Version="$(IntegrationVersion)" />
</ItemGroup>

<!-- Do NOT update these versions, it's for backward compatibility testing!!! -->
<ItemGroup>
<PackageReference Include="JetBrainsAnnotations.Fody" Version="2.10.0" PrivateAssets="All" />
<PackageReference Include="NullGuard.Fody" Version="1.8.5" PrivateAssets="All" />
<PackageReference Include="JetBrainsAnnotations.Fody" Version="2.17.0" PrivateAssets="All" />
<PackageReference Include="NullGuard.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
44 changes: 43 additions & 1 deletion Integration/SampleTargetWithConfigOverrideTests/FodyWeavers.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,49 @@
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="NullGuard" minOccurs="0" maxOccurs="1" type="xs:anyType" />
<xs:element name="NullGuard" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="IncludeDebugAssert" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control whether asserts are added into debug builds or not.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Mode">
<xs:annotation>
<xs:documentation>The operation mode of NullGuard.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="AutoDetect">
<xs:annotation>
<xs:documentation>Automatically detect the mode by the usage of JetBrains.Annotations.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Implicit">
<xs:annotation>
<xs:documentation>In implicit mode everything is assumed to be not-null, unless attributed with [AllowNull].</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="Explicit">
<xs:annotation>
<xs:documentation>In explicit mode everything is assumed to be nullable, unless attributed with [NotNull].</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="NullableReferenceTypes">
<xs:annotation>
<xs:documentation>Use C# 8 nullable reference type annotations.</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="ExcludeRegex" type="xs:string">
<xs:annotation>
<xs:documentation>A regular expression to specify the names of a classes to exclude from NullGuard.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="JetBrainsAnnotations" minOccurs="0" maxOccurs="1" type="xs:anyType" />
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" PrivateAssets="all" />
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="SampleWeaver.Fody" Version="$(IntegrationVersion)" />
</ItemGroup>

<!-- Do NOT update these versions, it's for backward compatibility testing!!! -->
<ItemGroup>
<PackageReference Include="JetBrainsAnnotations.Fody" Version="2.10.0" PrivateAssets="All" />
<PackageReference Include="NullGuard.Fody" Version="1.8.5" PrivateAssets="All" />
<PackageReference Include="JetBrainsAnnotations.Fody" Version="2.17.0" PrivateAssets="All" />
<PackageReference Include="NullGuard.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions Integration/Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
<PackageReference Include="Xunit" Version="2.4.1" />
<PackageReference Include="XunitContext" Version="3.0.0" />
<PackageReference Include="Verify.Xunit" Version="14.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="System.Reflection.Metadata" Version="8.0.0" />
<PackageReference Include="Xunit" Version="2.6.6" />
<PackageReference Include="XunitContext" Version="3.3.1" />
<PackageReference Include="Verify.Xunit" Version="23.0.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Integration/WithEmbeddedPdb/WithEmbeddedPdb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<ItemGroup>
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="SampleWeaver.Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="Virtuosity.Fody" Version="1.21.3" PrivateAssets="All" />
<PackageReference Include="Virtuosity.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Integration/WithNoPdb/WithNoPdb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<ItemGroup>
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="SampleWeaver.Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="Virtuosity.Fody" Version="1.21.3" PrivateAssets="All" />
<PackageReference Include="Virtuosity.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<ItemGroup>
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="Virtuosity.Fody" Version="1.21.3" PrivateAssets="All" />
<PackageReference Include="Virtuosity.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions Integration/WithNugetWeavers/WithNugetWeavers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
<ItemGroup>
<PackageReference Include="Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="SampleWeaver.Fody" Version="$(IntegrationVersion)" />
<PackageReference Include="Virtuosity.Fody" Version="1.21.3" PrivateAssets="All" />
<PackageReference Include="Virtuosity.Fody" Version="3.1.1" PrivateAssets="All" />
</ItemGroup>

<Target Name="VerifyThereAreNoWeaversInOutput" AfterTargets="PostBuildEvent">
<Error Condition="Exists('$(OutDir)Virtuosity.dll')"
Text="Virtuosity.dll found in build output" />
<Error Condition="Exists('$(OutDir)Virtuosity.dll')" Text="Virtuosity.dll found in build output" />
</Target>

</Project>
6 changes: 3 additions & 3 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

<ItemGroup>
<PackageReference Include="Nullable" Version="1.3.1" PrivateAssets="All" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="[17.1.0]" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.8.3" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Verify.Xunit" Version="22.9.0" />
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="Verify.Xunit" Version="23.0.1" />
<PackageReference Include="xunit" Version="2.6.6" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
Expand Down

0 comments on commit 904f2c4

Please sign in to comment.