Skip to content

Commit

Permalink
Merge pull request #557 from MindscapeHQ/ph/fix-build-cross-plat
Browse files Browse the repository at this point in the history
[Cleanup] Narrow target frameworks for tests and ensure we have braces
  • Loading branch information
phillip-haydon authored Jan 7, 2025
2 parents 263f3b8 + 217413b commit e5b0e74
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 24 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ resharper_convert_to_primary_constructor_highlighting = none

# Ensure if statements always use braces
csharp_prefer_braces = true:error

[SimpleJson.cs]
# Disable braces error for SimpleJson.cs since its an old 3rd party library
csharp_prefer_braces = true:none
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -27,7 +27,7 @@
<None Include="..\128x128-transparent.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="2.0.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Mindscape.Raygun4Net.Azure.WebJob/RaygunExceptionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public RaygunExceptionHandler(RaygunClient client)
_client = client;
_client.AddWrapperExceptions(typeof(FunctionInvocationException));
if (Tags == null)
{
Tags = new string[0];
}
}

/// <summary>
Expand Down
4 changes: 4 additions & 0 deletions Mindscape.Raygun4Net.Core/Mindscape.Raygun4Net.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Reflection.Metadata" Version="6.0.1" />
</ItemGroup>

Expand Down
4 changes: 4 additions & 0 deletions Mindscape.Raygun4Net.Mvc/Mindscape.Raygun4Net.Mvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNet.Mvc" Version="3.0.50813.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>Mindscape.Raygun4Net</RootNamespace>
</PropertyGroup>

Expand Down Expand Up @@ -33,7 +33,6 @@
<internalsVisibleTo Include="Mindscape.Raygun4Net.Maui, PublicKey=$(RaygunPublicKey)"/>
</ItemGroup>


<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\"/>
<None Include="..\LICENSE" Pack="true" PackagePath=""/>
Expand All @@ -43,7 +42,4 @@
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Reflection.Metadata" Version="6.0.1"/>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Reflection.Metadata" Version="6.0.1"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,39 @@
<PropertyGroup>
<!--Out of support versions which still compiles/works @ May 2022-->
<!--You may need to install extra SDK/Targeting packs to run these tests -->
<!-- <TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;netcoreapp2.0;netcoreapp1.1;netcoreapp1.0;net461;</TargetFrameworks>-->
<!-- <TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.2;netcoreapp2.1;netcoreapp2.0;netcoreapp1.1;netcoreapp1.0;net461;</TargetFrameworks>-->

<!-- Versions which are supported by Microsoft @ May 2022-->
<TargetFrameworks>net8.0;net7.0;net6.0;net48;net472;net471;net47;net462</TargetFrameworks>
<!-- Windows OS Tests -->
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">net8.0;net7.0;net6.0;net48;net472;net471;net47;net462</TargetFrameworks>
<!-- Linux OS Tests -->
<TargetFramework Condition="'$(OS)' != 'Windows_NT'">net8.0</TargetFramework>

<AssemblyVersion>1.0.0</AssemblyVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>embedded</DebugType>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\Raygun.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="skwas.MockHttp" Version="4.3.1" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="FluentAssertions" Version="6.12.0"/>
<PackageReference Include="NUnit" Version="4.0.1"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
<PackageReference Include="skwas.MockHttp" Version="4.3.1"/>
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Mindscape.Raygun4Net.NetCore\Mindscape.Raygun4Net.NetCore.csproj" />
<ProjectReference Include="..\Mindscape.Raygun4Net.NetCore.Common\Mindscape.Raygun4Net.NetCore.Common.csproj" />
<ProjectReference Include="..\Mindscape.Raygun4Net.NetCore\Mindscape.Raygun4Net.NetCore.csproj"/>
<ProjectReference Include="..\Mindscape.Raygun4Net.NetCore.Common\Mindscape.Raygun4Net.NetCore.Common.csproj"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.1.1" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="NUnit.Analyzers" Version="4.0.1">
Expand Down
7 changes: 7 additions & 0 deletions Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,12 @@
<None Include="..\LICENSE" Pack="true" PackagePath="" />
<None Include="..\128x128-transparent.png" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net462" Version="1.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestMinor",
"version": "6.0.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}

0 comments on commit e5b0e74

Please sign in to comment.