Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding NetStandard for Abstractions project #664

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<OldestSupportedDotNetVersion>net7.0</OldestSupportedDotNetVersion>
<NetCoreVersions>$(LatestSupportedDotNetVersion)</NetCoreVersions>
<NetCoreVersions Condition="'$(LatestSupportedDotNetVersion)' != '$(OldestSupportedDotNetVersion)'">$(LatestSupportedDotNetVersion);$(OldestSupportedDotNetVersion)</NetCoreVersions>
<LibraryTargetFrameworks>$(NetCoreVersions)</LibraryTargetFrameworks>
<ExecutableTargetFrameworks>$(NetCoreVersions)</ExecutableTargetFrameworks>
<NetStandardVersions>netstandard2.0</NetStandardVersions>
<LibraryTargetFrameworks>$(NetCoreVersions);$(NetStandardVersions)</LibraryTargetFrameworks>
</PropertyGroup>
<PropertyGroup Label="UnitTest Targets">
<UnitTestTargetFrameworks>$(NetCoreVersions)</UnitTestTargetFrameworks>
Expand All @@ -25,6 +25,9 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Label="Condition Variables" >
<IsNetStandard>$(NetStandardVersions.Contains('$(TargetFramework)'))</IsNetStandard>
</PropertyGroup>
<PropertyGroup Label="Signing" >
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup Label="Latest DotNet Package Versions. AutoUpdate" Condition="'$(TargetFramework)' == '$(LatestSupportedDotNetVersion)'">
<ItemGroup Label="Latest DotNet Package Versions. AutoUpdate" Condition="'$(TargetFramework)' == '$(LatestSupportedDotNetVersion)' OR '$(IsNetStandard)'">
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
Expand Down
1 change: 0 additions & 1 deletion Omex.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
global.json = global.json
NuGet.Config = NuGet.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
</ItemGroup>
<ItemGroup Condition="$(IsNetStandard)">
<PackageReference Include="System.Threading.Tasks.Extensions" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Abstractions/Validation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static string ThrowIfNullOrWhiteSpace(string? value, string? name = null)
{
if (!string.IsNullOrWhiteSpace(value))
{
return value;
return value!; // `!` required because in netstandard2.0 IsNullOrWhiteSpace does not have proper attributes
}

_ = value ?? throw new ArgumentNullException(name);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
<Title>Microsoft.Omex.Extensions.Activities</Title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
Expand Down
2 changes: 1 addition & 1 deletion src/Hosting/Microsoft.Omex.Extensions.Hosting.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
<Title>Microsoft.Omex.Extensions.Hosting</Title>
Expand Down
2 changes: 1 addition & 1 deletion src/Logging/Microsoft.Omex.Extensions.Logging.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
<Title>Microsoft.Omex.Extensions.Logging</Title>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<PropertyGroup Label="NuGet Properties">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>$(LibraryTargetFrameworks)</TargetFrameworks>
<TargetFrameworks>$(NetCoreVersions)</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="NuGet Properties">
Expand Down
Loading