Skip to content

Commit 03ebcc2

Browse files
niheavenr15ch13
authored andcommitted
supporting: Update Newtonsoft.Json to 11.0.2, Newtonsoft.Json.Schema to 3.0.10 (#3043)
- Update supporting\validator\bin\Newtonsoft.Json to 11.0.2 - **HIGHLIGHT**: support for regex operator in JSON Paths - Latest Newtonsoft.Json version is 12.0.1, which has some compatibility issues with Json.Schema 3.0.10 and PowerShell Core 6.1.12 (On my PC) - Update supporting\validator\bin\Newtonsoft.Json.Schema to 3.0.10 - Use .NET 4.5 instead of .NET 4.0, since Scoop's requirements is [.NET Framework 4.5+](https://github.com/lukesampson/scoop#requirements) - Modify `json_path()` to escape `$version` substitutions when `$jsonpath` has regex **EXAMPLE OF JPATH REGEX** ```json "checkver": { "url": "https://dist.nuget.org/index.json", "jp": "$..versions[?(@.displayName =~ /.*recommended.*/)].version" } ```
1 parent 28f7457 commit 03ebcc2

11 files changed

Lines changed: 23 additions & 27 deletions

File tree

lib/json.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function ConvertToPrettyJson {
9595
function json_path([String] $json, [String] $jsonpath, [Hashtable] $substitutions) {
9696
Add-Type -Path "$psscriptroot\..\supporting\validator\bin\Newtonsoft.Json.dll"
9797
if ($null -ne $substitutions) {
98-
$jsonpath = substitute $jsonpath $substitutions
98+
$jsonpath = substitute $jsonpath $substitutions ($jsonpath -like "*=~*")
9999
}
100100
try {
101101
$obj = [Newtonsoft.Json.Linq.JObject]::Parse($json)

supporting/shimexe/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Microsoft.Net.Compilers" version="2.6.1" targetFramework="net40" developmentDependency="true" />
4-
</packages>
3+
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net45" developmentDependency="true" />
4+
</packages>

supporting/shimexe/shim.csproj

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props')" />
4-
<Import Project="packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props')" />
3+
<Import Project="packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props" Condition="Exists('packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" />
54
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
65
<PropertyGroup>
76
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -10,7 +9,7 @@
109
<OutputType>Exe</OutputType>
1110
<RootNamespace>Scoop.Shim</RootNamespace>
1211
<AssemblyName>Scoop.Shim</AssemblyName>
13-
<TargetFrameworkVersion>v4.0.0</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.5.0</TargetFrameworkVersion>
1413
<FileAlignment>512</FileAlignment>
1514
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1615
</PropertyGroup>
@@ -32,7 +31,6 @@
3231
<PropertyGroup>
3332
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
3433
</PropertyGroup>
35-
<Error Condition="!Exists('packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.2.3.2\build\Microsoft.Net.Compilers.props'))" />
36-
<Error Condition="!Exists('packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.2.6.1\build\Microsoft.Net.Compilers.props'))" />
34+
<Error Condition="!Exists('packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Net.Compilers.2.10.0\build\Microsoft.Net.Compilers.props'))" />
3735
</Target>
3836
</Project>
11.5 KB
Binary file not shown.
134 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
52cc6ddf77990fbaaae4db593f655610652133ceeadb32262c122d8c9eea1bad *Newtonsoft.Json.dll
2-
8643f860be0e5592e73219b6d5e993265f336d3bf2c93d6db5a2e918d3c3f177 *Newtonsoft.Json.Schema.dll
3-
306de31359895c96e1b91df29a216b65a7aa3f353251ba3e5ad129906fcfc77b *Scoop.Validator.dll
1+
f58c374ffcaae4e36d740d90fbf7fe70d0abb7328cd9af3a0a7b70803e994ba4 *Newtonsoft.Json.dll
2+
4ca0681df3755205cfd178aaa38f7fd6818c183c4d14c77cd77f8d777282a650 *Newtonsoft.Json.Schema.dll
3+
e077a05608126d44938158da04fe2062513afedba666648ed185d3e25b50436e *Scoop.Validator.dll
44
cc82c9659716b564a69690a8b67e5472ea1e8e060b974306314acdd42767bf6d *validator.exe
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
4639a7f77f7a9cafa38c632332dd5085355623f3d84475374241a64bd110569f504086b479b519e90ddbd471d4a5034239418ebc03277424212e0e6698e64418 *Newtonsoft.Json.dll
2-
0c39a3c8e514fde4d629f11f94e6c7acdcd196cd1229c3ef5a6a0455c1cdf4dbf3fda24dd9392b05e917cb85ec745393595086078d1437343dded52f2c0011f3 *Newtonsoft.Json.Schema.dll
3-
d133d47dbeda60571090fc4159e3575b40ddaddef858b56e0103ad531dc4612a9d4bdbee8a6b5dd4e0d5abeb549afadd059767058b568e4d5d31990a42631743 *Scoop.Validator.dll
1+
7cbbbef742f56af80f1012d7da86fe5375ac05813045756fb45d0691c36ef13c069361457500ba4200157d5ee7922fd118bf4c0635e5192e3f8c6183fd580944 *Newtonsoft.Json.dll
2+
2d9c630948c21b325af7b7ad3de9219a3fdcc23fa65270a0cdb78ea9609038434f6b741a968e9758f93782a3bab57efc3072429bdf84f8ad25a94bf5a8c4bc48 *Newtonsoft.Json.Schema.dll
3+
15b0aa8b29f4e7d74ae3ff36ce7d72f6243a9b7f35890df3e549340c27edf37a73a9d16132254baf661a9aadc6fd5870d3b04452b78df79e3ccf9bee1c9bd788 *Scoop.Validator.dll
44
384d22bfb21b2767de862f95945dca91aefb4b5eca687d20e410dc64059c5402a13c085517cb807635ff07397fee9bda31b0fdc0090c24cb424f62b285ea0477 *validator.exe

supporting/validator/build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Write-Host "Install dependencies ..."
55
Invoke-Expression "$psscriptroot\install.ps1"
66

77
$output = "$psscriptroot\bin"
8-
Get-ChildItem "$psscriptroot\packages\Newtonsoft.*\lib\net40\*.dll" -File | ForEach-Object { Copy-Item $_ $output }
8+
Get-ChildItem "$psscriptroot\packages\Newtonsoft.*\lib\net45\*.dll" -File | ForEach-Object { Copy-Item $_ $output }
99
Write-Output 'Compiling Scoop.Validator.cs ...'
1010
& "$psscriptroot\packages\Microsoft.Net.Compilers\tools\csc.exe" /deterministic /platform:anycpu /nologo /optimize /target:library /reference:"$output\Newtonsoft.Json.dll","$output\Newtonsoft.Json.Schema.dll" /out:"$output\Scoop.Validator.dll" Scoop.Validator.cs
1111
Write-Output 'Compiling validator.cs ...'
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" />
4-
<package id="Newtonsoft.Json.Schema" version="3.0.5" targetFramework="net40" />
5-
<package id="Microsoft.Net.Compilers" version="2.6.1" targetFramework="net40" developmentDependency="true" />
6-
</packages>
3+
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net45" />
4+
<package id="Newtonsoft.Json.Schema" version="3.0.10" targetFramework="net45" />
5+
<package id="Microsoft.Net.Compilers" version="2.10.0" targetFramework="net45" developmentDependency="true" />
6+
</packages>

0 commit comments

Comments
 (0)