Skip to content

Commit

Permalink
Merge branch 'release/0.70.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Nov 21, 2023
2 parents b6637a3 + 8dd6719 commit 7799d2c
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "3.2.0",
"version": "4.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>ZoomNet.IntegrationTests</AssemblyName>
<RootNamespace>ZoomNet.IntegrationTests</RootNamespace>
</PropertyGroup>
Expand Down
8 changes: 4 additions & 4 deletions Source/ZoomNet.UnitTests/ZoomNet.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
<AssemblyName>ZoomNet.UnitTests</AssemblyName>
<RootNamespace>ZoomNet.UnitTests</RootNamespace>
<IsPackable>false</IsPackable>
Expand All @@ -12,16 +12,16 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.6.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
17 changes: 13 additions & 4 deletions Source/ZoomNet/Json/JsonFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,19 @@ public override void Serialize(Type type, object value, Stream stream, HttpConte
{
if (type == typeof(JsonObject))
{
// As of .NET 6.0, serializing a JsonObject does NOT respect 'JsonIgnoreCondition.WhenWritingNull'.
// This is a documented shortcoming that is currently considered "as designed" by the .NET team.
// See: https://github.com/dotnet/runtime/issues/54184 and https://github.com/dotnet/docs/issues/27824
// Hopefully, this will be addressed and this workaround will no longer be necessary in .NET 7.0
/*
When upgrading to .NET 6.0, I discovered that serializing a JsonObject does NOT respect 'JsonIgnoreCondition.WhenWritingNull'.
This is a documented shortcoming that is currently considered "as designed" by the .NET team.
See: https://github.com/dotnet/runtime/issues/54184 and https://github.com/dotnet/docs/issues/27824
This behavior has not changed in .NET 7.0.
Microsoft made the decision to keep the behavior but improve the documentation to ensure developers are aware of it:
https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/use-dom#jsonnode-with-jsonserializeroptions
That's why I wrote the following workaround which removes properties that contain a null value prior to serializing the JsonObject.
*/

var valueAsJsonObject = (JsonObject)value;
var nullProperties = valueAsJsonObject
.Where(kvp => kvp.Value == null)
Expand Down
2 changes: 1 addition & 1 deletion Source/ZoomNet/Models/MeetingSettings.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using ZoomNet.Json;

namespace ZoomNet.Models
{
Expand Down
11 changes: 8 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#tool dotnet:?package=coveralls.net&version=4.0.1
#tool nuget:?package=GitReleaseManager&version=0.16.0
#tool nuget:?package=ReportGenerator&version=5.2.0
#tool nuget:?package=xunit.runner.console&version=2.6.1
#tool nuget:?package=xunit.runner.console&version=2.6.2
#tool nuget:?package=CodecovUploader&version=0.7.1

// Install addins.
Expand Down Expand Up @@ -74,8 +74,9 @@ var benchmarkProject = $"{sourceFolder}{libraryName}.Benchmark/{libraryName}.Ben
var buildBranch = Context.GetBuildBranch();
var repoName = Context.GetRepoName();

var versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
var milestone = versionInfo.MajorMinorPatch;
var versionInfo = (GitVersion)null; // Will be calculated in SETUP
var milestone = string.Empty; // Will be calculated in SETUP

var cakeVersion = typeof(ICakeContext).Assembly.GetName().Version.ToString();
var isLocalBuild = BuildSystem.IsLocalBuild;
var isMainBranch = StringComparer.OrdinalIgnoreCase.Equals("main", buildBranch);
Expand Down Expand Up @@ -116,6 +117,10 @@ Setup(context =>
context.Log.Verbosity = Verbosity.Diagnostic;
}

Information("Calculating version info...");
versionInfo = GitVersion(new GitVersionSettings() { OutputType = GitVersionOutput.Json });
milestone = versionInfo.MajorMinorPatch;

Information("Building version {0} of {1} ({2}, {3}) using version {4} of Cake",
versionInfo.LegacySemVerPadded,
libraryName,
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.404",
"version": "8.0.100",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down

0 comments on commit 7799d2c

Please sign in to comment.