Skip to content

Commit

Permalink
Update external dependencies (#2128)
Browse files Browse the repository at this point in the history
* Update external dependencies

* Minor issues with new Analyzers

* Fix obsolete functions

---------

Co-authored-by: Jose Perez Rodriguez <[email protected]>
  • Loading branch information
pgrawehr and joperezr committed Nov 16, 2023
1 parent d2cb9a2 commit 6b827cd
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 38 deletions.
2 changes: 1 addition & 1 deletion eng/Analyzers.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ file which is not marked as such, making StyleCop fail. -->
</PropertyGroup>
<ItemGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Link="stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion eng/StyleCop.Analyzers.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<Rule Id="SA1515" Action="None" /> <!-- Single-line comment should be preceded by blank line -->
<Rule Id="SA1516" Action="None" /> <!-- Elements should be separated by blank line -->
<Rule Id="SA1517" Action="Error" />
<Rule Id="SA1518" Action="Error" />
<Rule Id="SA1518" Action="None" /> <!-- Files must end with exactly one newline -->
<Rule Id="SA1519" Action="Error" />
<Rule Id="SA1520" Action="Error" />
<Rule Id="SA1600" Action="None" /> <!-- Elements should be documented -->
Expand Down
11 changes: 6 additions & 5 deletions eng/Versions.external.props
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<Project>
<!-- These references to third-party libraries are included in all projects except System.Device.Gpio and the build wrapper project -->
<ItemGroup Condition="'$(MSBuildProjectName)' != 'System.Device.Gpio' And '$(MSBuildProjectName)' != 'build'">
<PackageReference Include="UnitsNet" Version="5.1.0" />
<PackageReference Include="UnitsNet" Version="5.31.0" />
</ItemGroup>

<!-- Automatically include these assemblies in all test projects -->
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('Tests'))">
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.utility" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit.runner.utility" Version="2.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Shouldly" Version="4.2.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/System.Device.Gpio.Tests/GpioPinTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void TestOpenPin()
// Act
GpioPin pin = ctrl.OpenPin(PinNumber, PinMode.Input);
// Assert
Assert.Equal(pin.PinNumber, PinNumber);
Assert.Equal(PinNumber, pin.PinNumber);
Assert.Equal(PinMode.Input, pin.GetPinMode());
}

Expand Down
2 changes: 1 addition & 1 deletion src/devices/Ags01db/Ags01db.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
<None Remove="README.md" />
<None Remove="sensor.jpg" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/devices/Ags01db/Register.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ internal enum Register : byte
ASG_VERSION_MSB = 0x0A,
ASG_VERSION_LSB = 0x01
}
}
}
13 changes: 0 additions & 13 deletions src/devices/Button/tests/Button.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@
<RootNamespace>Iot.Device.Button.Tests</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Button.csproj" />
</ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions src/devices/Card/Ndef/tests/Ndef.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Ndef.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/devices/HardwareMonitor/OpenHardwareMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ private void MonitorThread()
/// <exception cref="ArgumentOutOfRangeException"><paramref name="monitoringInterval"/> is less than 0.</exception>
public void EnableDerivedSensors(Area cpuDieSize = default, TimeSpan monitoringInterval = default)
{
if (cpuDieSize.Equals(Area.Zero, 0, ComparisonType.Absolute))
if (cpuDieSize.Equals(Area.Zero, Area.Zero))
{
// Values for some recent intel chips (coffee lake)
if (LogicalProcessors <= 4)
Expand Down
8 changes: 4 additions & 4 deletions src/devices/Nmea0183/tests/Ais/AisTargetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void ExtrapolatePositionWithRotation()
ship.RateOfTurn = RotationalSpeed.FromDegreesPerMinute(10);
ship2 = ship.EstimatePosition(TimeSpan.FromMinutes(10), TimeSpan.FromSeconds(20));
Assert.Equal(Angle.FromDegrees(100).Value, ship2.CourseOverGround.Value, 3);
Assert.Equal(45.015124163, ship2.Position.Latitude, 9);
Assert.Equal(9.026965951, ship2.Position.Longitude, 9);
Assert.Equal(45.015124163, ship2.Position.Latitude, 7);
Assert.Equal(9.026965951, ship2.Position.Longitude, 7);
}

[Fact]
Expand Down Expand Up @@ -81,8 +81,8 @@ public void ExtrapolatePositionWithRotationAndGivenTime()
var ship2 = ship.EstimatePosition(t + TimeSpan.FromMinutes(10), TimeSpan.FromSeconds(20));
Assert.Equal(t + TimeSpan.FromMinutes(10), ship2.LastSeen);
Assert.Equal(Angle.FromDegrees(100).Value, ship2.CourseOverGround.Value, 3);
Assert.Equal(45.015124163, ship2.Position.Latitude, 9);
Assert.Equal(9.026965951, ship2.Position.Longitude, 9);
Assert.Equal(45.015124163, ship2.Position.Latitude, 7);
Assert.Equal(9.026965951, ship2.Position.Longitude, 7);
}
}
}
3 changes: 0 additions & 3 deletions src/devices/Nmea0183/tests/Nmea0183.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,5 @@
<ItemGroup>
<ProjectReference Include="..\Nmea0183.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Shouldly" Version="4.0.3" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/devices/Nmea0183/tests/SentenceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void XteDecode()
CrossTrackError xte = (CrossTrackError)decoded!.TryGetTypedValue(ref _lastPacketTime)!;

Assert.True(xte.Valid);
Assert.True(xte.Distance.Equals(Length.Zero, 0, ComparisonType.Absolute));
Assert.True(xte.Distance.Equals(Length.Zero, Length.Zero));
}

[Fact]
Expand Down
2 changes: 1 addition & 1 deletion tools/ArduinoCsCompiler/ArduinoCsCompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="3.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.5.0" />
<ProjectReference Include="..\..\src\devices\Arduino\Arduino.csproj" />
<ProjectReference Include="..\..\src\System.Device.Gpio\System.Device.Gpio.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion tools/ArduinoCsCompiler/Frontend/CompilerRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public override bool RunCommand()
Logger.LogInformation($"Recommended minimum values are 512 kB of flash and 100 kB of RAM. Some microcontrollers (e.g. ESP32) may allow configuration of the amount of flash " +
$"available for code.");

if (!caps.IntSize.Equals(Information.FromBytes(4), 0, ComparisonType.Absolute) || !caps.PointerSize.Equals(Information.FromBytes(4), 0, ComparisonType.Absolute))
if (!caps.IntSize.Equals(Information.FromBytes(4), Information.Zero) || !caps.PointerSize.Equals(Information.FromBytes(4), Information.Zero))
{
Logger.LogWarning("Board pointer and/or integer size is not 32 bits. This is untested and may lead to unpredictable behavior.");
}
Expand Down

0 comments on commit 6b827cd

Please sign in to comment.