-
Notifications
You must be signed in to change notification settings - Fork 734
System.Text.Json Migration - Adding code to parse the Project.Assets.Json file using STJ. #5558
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
Merged
jgonz120
merged 43 commits into
dev-jgonz120-FeatureBranch-Stj-Migration
from
dev-FeatureBranch-jgonz120-Stj-LockfileFormat-Migration
Jan 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
a57aabf
Copied initial files over and addressred some PR comments
jgonz120 05ed3db
Test updates
jgonz120 c285f0f
optimized string split
jgonz120 c06e3f5
cleanup
jgonz120 ef90a51
switch to stream
jgonz120 4c31cbf
fix typo
jgonz120 b787826
fix typo
jgonz120 c627b25
create static json reader state
jgonz120 ef35381
typo
jgonz120 084986d
typo
jgonz120 5850754
added lazy string split
jgonz120 014739f
using
jgonz120 d28a482
Update unit tests
jgonz120 c9cb53f
unit tests
jgonz120 d083e23
fix references
jgonz120 0b22126
Fix typo
jgonz120 e81974f
Added test for invalid logs
jgonz120 d2cc5d6
removed extra name assignment from package spec reader
jgonz120 2de68c4
use array empty
jgonz120 79e2b71
move public method up
jgonz120 ccd6fe1
remove uneeded string list
jgonz120 8d719c6
use false string
jgonz120 212b7bd
add is final block to test
jgonz120 b5a82d7
rename test
jgonz120 82363ee
style
jgonz120 0cc4e51
style
jgonz120 c525dc8
add tests for validating empty streams on creationg of utf8jsonstream…
jgonz120 4e5112a
Added test and implemented string split in two
jgonz120 2398980
fix validation for lazy string split
jgonz120 1693913
reduce methods in LikeFileFormat
jgonz120 e0ef66d
set the list values with the results directly
jgonz120 b4d0169
store environment variable to avoid calling GetEnvironmentVariable se…
jgonz120 f060670
switch to splitintwo
jgonz120 4602b44
Update conditional for framework
jgonz120 a240062
Caching the parsed NugetVersion and VersionRange objects.
jgonz120 0883567
Fixes from PR
jgonz120 c4adaf7
Avoid creating empty lists
jgonz120 bda30bb
Revert "Caching the parsed NugetVersion and VersionRange objects."
jgonz120 fb7ebd5
Fix netwonsoft json parsing
jgonz120 32aba9a
Add missing reference
jgonz120 8853734
added some examples of the json to be parsed
jgonz120 1b29455
Fix references in comments
jgonz120 1877448
Fixes from PR
jgonz120 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
unit tests
- Loading branch information
commit c9cb53f9ca4c70f14af780bb292ec01fdc549ca9
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
806 changes: 378 additions & 428 deletions
806
test/NuGet.Core.Tests/NuGet.ProjectModel.Test/JsonPackageSpecReaderTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
test/NuGet.Core.Tests/NuGet.ProjectModel.Test/LockFileParsingEnvironmentVariable.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // Copyright (c) .NET Foundation. All rights reserved. | ||
| // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
|
||
| using System.Collections.Generic; | ||
| using Test.Utility; | ||
|
|
||
| namespace NuGet.ProjectModel | ||
| { | ||
| public class LockFileParsingEnvironmentVariable | ||
| { | ||
| public static IEnumerable<object[]> TestEnvironmentVariableReader() | ||
| { | ||
| return GetTestEnvironmentVariableReader(); | ||
| } | ||
|
|
||
| public static IEnumerable<object[]> TestEnvironmentVariableReader(object value1) | ||
| { | ||
| return GetTestEnvironmentVariableReader(value1); | ||
| } | ||
|
|
||
| public static IEnumerable<object[]> TestEnvironmentVariableReader(object value1, object value2) | ||
| { | ||
| return GetTestEnvironmentVariableReader(value1, value2); | ||
| } | ||
|
|
||
| public static IEnumerable<object[]> TestEnvironmentVariableReader(object value1, object value2, object value3) | ||
| { | ||
| return GetTestEnvironmentVariableReader(value1, value2, value3); | ||
| } | ||
|
|
||
| private static IEnumerable<object[]> GetTestEnvironmentVariableReader(params object[] objects) | ||
| { | ||
| var UseNjForFileTrue = new List<object> { | ||
| new TestEnvironmentVariableReader( | ||
| new Dictionary<string, string>() | ||
| { | ||
| ["NUGET_EXPERIMENTAL_USE_NJ_FOR_FILE_PARSING"] = bool.TrueString | ||
| }, "NUGET_EXPERIMENTAL_USE_NJ_FOR_FILE_PARSING: true") | ||
| }; | ||
| var UseNjForFileFalse = new List<object> { | ||
| new TestEnvironmentVariableReader( | ||
| new Dictionary<string, string>() | ||
| { | ||
| ["NUGET_EXPERIMENTAL_USE_NJ_FOR_FILE_PARSING"] = bool.FalseString | ||
| }, "NUGET_EXPERIMENTAL_USE_NJ_FOR_FILE_PARSING: false") | ||
| }; | ||
|
|
||
| if (objects != null) | ||
| { | ||
| UseNjForFileFalse.AddRange(objects); | ||
| UseNjForFileTrue.AddRange(objects); | ||
| } | ||
|
|
||
| return new List<object[]> | ||
| { | ||
| UseNjForFileTrue.ToArray(), | ||
| UseNjForFileFalse.ToArray() | ||
| }; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.