Update M.E.DependencyModel to use S.T.Json source for netstandard2.0 (dotnet/core...
authorAhson Khan <ahkha@microsoft.com>
Tue, 29 Jan 2019 06:14:35 +0000 (22:14 -0800)
committerGitHub <noreply@github.com>
Tue, 29 Jan 2019 06:14:35 +0000 (22:14 -0800)
commit4350361f0cbefb6be642261add9151ac6cb7b5b6
tree8068c1eb20a718a4e92d4b3e92be1e5c34b7892e
parentb4c479785d61d5f9a84375e21e986b0f818f9a92
Update M.E.DependencyModel to use S.T.Json source for netstandard2.0 (dotnet/core-setup#5009)

* Update M.E.DependencyModel to use in-box S.T.Json for netstandard2.0

* Move StreamBufferWriter to a separate file.

* Return array back to the pool on success.

* Update test json and remove trailing commas to make it valid according
to RFC.

* Fix off-by-one error in skip, add a null string check, and remove other
trailing commas.

* Write end of object before flushing.

* Add missing write end array to close the array block.

* Update to latest source package with some API changes.

* Address PR feedback.

* Split DepContextJsonReader into common, newtonsoft, and netstandard.

* Try to minimize the diff between Newtonsoft and S.T.Json.

* Remove the .Common prefix for the source that is shared between the
impls.

* Explicitly add access modifiers and some code formatting fix.

* Add debug asserts and add comment to where ReadToEnd comes from.

* Mark methods as static where possible.

* Update code formatting (use var, inline outs, etc.)

* Use implicit cast to span and use try/finally block instead.

* Always check to resize in case stream.Length changes.

* Use an array-based buffer writer rather than one that supports stream.

* Add a unified json reader to reduce code duplication.

* Remove JsonTextReaderExtensions and cleanup some changes to keep the
diff cleaner.

* Skip comments by default.

* Allow comments on the reader but throw FormatException to mimic current
behavior.

* Adjust the exception message comparion assert.

* Use the latest LangVersion (7.3) required by the source package.

* Rename partial files using Utf8JsonReader/JsonTextReader suffixes.

* Address PR feedback - cleanup csproj and remove unused APIs.

* Use JsonTextWriter (instead of JObject) and extract out common code by
using UnifiedJsonWriter
extract out common code by using UnifiedJsonWriterr

* Rename Write to WriteCore to match the Read

* Explicitly disallow comments and update test to assert
JsonReaderException.

* Add source package version to Versions.props.

Commit migrated from https://github.com/dotnet/core-setup/commit/45f9401bf62faf0d3446cfd8681d35cc3487367a
16 files changed:
src/installer/managed/Microsoft.Extensions.DependencyModel/ArrayBufferWriter.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.JsonTextReader.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.Utf8JsonReader.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextJsonReader.cs
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextStrings.cs
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.JsonTextWriter.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.Utf8JsonWriter.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/DependencyContextWriter.cs
src/installer/managed/Microsoft.Extensions.DependencyModel/JsonTextReaderExtensions.cs [deleted file]
src/installer/managed/Microsoft.Extensions.DependencyModel/Microsoft.Extensions.DependencyModel.csproj
src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.JsonTextReader.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonReader.Utf8JsonReader.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.JsonTextWriter.cs [new file with mode: 0644]
src/installer/managed/Microsoft.Extensions.DependencyModel/UnifiedJsonWriter.Utf8JsonWriter.cs [new file with mode: 0644]
src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextJsonReaderTest.cs
src/installer/test/Microsoft.Extensions.DependencyModel.Tests/DependencyContextLoaderTests.cs