Skip to content

Commit

Permalink
Remove netstandard2.0 support, part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrawehr committed Sep 18, 2024
1 parent e4dbed2 commit cdd5d26
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 77 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
5 changes: 1 addition & 4 deletions src/Iot.Device.Bindings/Iot.Device.Bindings.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<DefineConstants>$(DefineConstants);BUILDING_IOT_DEVICE_BINDINGS</DefineConstants>
Expand Down Expand Up @@ -41,9 +41,6 @@
<!-- This package is only used for windows specific stuff. -->
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="../devices/CharacterLcd/BigFontMap.txt" />
<EmbeddedResource Include="../devices/BuildHat/data/firmware.bin" />
Expand Down
59 changes: 1 addition & 58 deletions src/System.Device.Gpio/System.Device.Gpio.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition="$(NETCoreSdkRuntimeIdentifier.StartsWith('win'))">$(TargetFrameworks);net6.0-windows10.0.17763.0</TargetFrameworks>
<TargetFrameworks>net6.0;</TargetFrameworks>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -10,66 +9,10 @@
</PropertyGroup>

<ItemGroup>
<Compile Remove="winmd\**" />
<EmbeddedResource Remove="winmd\**" />
<None Remove="winmd\**" />
<None Include="buildTransitive\net5.0\System.Device.Gpio.targets" Pack="true" PackagePath="\buildTransitive\net5.0" />
<PackageReference Include="Microsoft.DotNet.GenAPI" Version="$(MicrosoftDotNetGenApiPackageVersion)">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<Content Include="$(RepoRoot)README-nuget.md" Pack="true" Visible="false" PackagePath="\README.md" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryPackageVersion)" /> <!-- This is Windows specific -->
<PackageReference Include="System.Memory" Version="$(SystemMemoryPackageVersion)" />
<PackageReference Include="System.Runtime.WindowsRuntime" Version="$(SystemRuntimeWindowsRuntimePackageVersion)" />
<PackageReference Include="System.Runtime.InteropServices.WindowsRuntime" Version="$(SystemRuntimeInteropServicesWindowsRuntimePackageVersion)" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="$(SystemThreadingTasksExtensionsPackageVersion)" />

<Reference Include="Windows.Devices.DevicesLowLevelContract">
<HintPath>winmd\Windows.Devices.DevicesLowLevelContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="Windows.Foundation.FoundationContract">
<HintPath>winmd\Windows.Foundation.FoundationContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
<Reference Include="Windows.Foundation.UniversalApiContract">
<HintPath>winmd\Windows.Foundation.UniversalApiContract.winmd</HintPath>
<IsWinMDFile>true</IsWinMDFile>
</Reference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
<!--Remove the Linux-specific code-->
<Compile Remove="System\Device\Gpio\Drivers\Windows10Driver.notSupported.cs" />
<Compile Remove="System\Device\I2c\I2cDevice.nonWindows.cs" />
<Compile Remove="System\Device\I2c\I2cBus.nonWindows.cs" />
<Compile Remove="System\Device\Pwm\PwmChannel.nonWindows.cs" />
<Compile Remove="System\Device\Spi\SpiDevice.nonWindows.cs" />
<Compile Remove="System\Device\CommonHelpers.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<!--Remove Windows Code-->
<Compile Remove="Interop\Windows\WinRT\*.cs" />
<Compile Remove="System\Device\Gpio\Drivers\Windows10DriverPin.cs" />
<Compile Remove="System\Device\Gpio\Drivers\Windows10Driver.cs" />
<Compile Remove="System\Device\I2c\Devices\Windows10I2cBus.cs" />
<Compile Remove="System\Device\I2c\Devices\Windows10I2cDevice.cs" />
<Compile Remove="System\Device\I2c\Devices\Windows10I2cBusDevice.cs" />
<Compile Remove="System\Device\Pwm\Channels\Windows10PwmChannel.cs" />
<Compile Remove="System\Device\Spi\Devices\Windows10SpiDevice.cs" />
<Compile Remove="System\Device\I2c\I2cDevice.Windows.cs" />
<Compile Remove="System\Device\I2c\I2cBus.Windows.cs" />
<Compile Remove="System\Device\Pwm\PwmChannel.Windows.cs" />
<Compile Remove="System\Device\Spi\SpiDevice.Windows.cs" />

</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<!-- Need this for record support in older runtimes -->
<Compile Remove="System\Device\IsExternalInit.cs" />
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/devices/Common/Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,4 @@
<!-- The following is supported on windows only. We need it to take screenshots under windows -->
<PackageReference Include="System.Drawing.Common" Version="$(SystemDrawingCommonPackageVersion)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="FrameworkCompatibilityExtensions.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<Compile Include="IsExternalInit.cs" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/devices/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<!-- Most projects should use this value to build for all possible target frameworks -->
<DefaultBindingTfms>net6.0;netstandard2.0;</DefaultBindingTfms>
<DefaultBindingTfms>net6.0;</DefaultBindingTfms>
<DefaultSampleTfms>net6.0</DefaultSampleTfms>
<DefaultTestTfms>net6.0</DefaultTestTfms>
<NoWarn>$(NoWarn);CS8321</NoWarn>
Expand Down
3 changes: 0 additions & 3 deletions src/devices/Nmea0183/Nmea0183.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
<ProjectReference Include="..\Rtc\Rtc.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="$(MicrosoftExtensionsLoggingPackageVersion)" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework) == 'netstandard2.0'">
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
</ItemGroup>
<!-- Make the internal classes visible to the unit test assembly -->
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
Expand Down
2 changes: 1 addition & 1 deletion src/devices/System.Device.Model/System.Device.Model.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultBindingTfms)</TargetFrameworks>
</PropertyGroup>

</Project>

0 comments on commit cdd5d26

Please sign in to comment.