Skip to content

Commit

Permalink
Update json validator
Browse files Browse the repository at this point in the history
* Update Newtonsoft.Json to version 10.0.3
* Update Newtonsoft.Json.Schema to version 3.0.3
* Add Microsoft.Net.Compiles dependency
* Improve build/update process
* Use deterministic builds for Scoop.Validator.dll and validator.exe
  • Loading branch information
r15ch13 committed Sep 10, 2017
1 parent 02b280f commit 99820e8
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 8 deletions.
Binary file modified supporting/validator/Newtonsoft.Json.Schema.dll
Binary file not shown.
Binary file modified supporting/validator/Newtonsoft.Json.dll
Binary file not shown.
Binary file modified supporting/validator/Scoop.Validator.dll
Binary file not shown.
8 changes: 3 additions & 5 deletions supporting/validator/build.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
$fwdir = gci C:\Windows\Microsoft.NET\Framework\ -dir | sort -desc | select -first 1

pushd $psscriptroot
& nuget restore -solutiondirectory .
iex "$psscriptroot\install.ps1"
gci $psscriptroot\packages\Newtonsoft.*\lib\net40\*.dll -file | % { copy-item $_ $psscriptroot }
& "$($fwdir.fullname)\csc.exe" /platform:anycpu /nologo /optimize /target:library /reference:Newtonsoft.Json.dll,Newtonsoft.Json.Schema.dll Scoop.Validator.cs
& "$($fwdir.fullname)\csc.exe" /platform:anycpu /nologo /optimize /target:exe /reference:Scoop.Validator.dll,Newtonsoft.Json.dll,Newtonsoft.Json.Schema.dll validator.cs
& "$psscriptroot\packages\Microsoft.Net.Compilers\tools\csc.exe" /deterministic /platform:anycpu /nologo /optimize /target:library /reference:Newtonsoft.Json.dll,Newtonsoft.Json.Schema.dll Scoop.Validator.cs
& "$psscriptroot\packages\Microsoft.Net.Compilers\tools\csc.exe" /deterministic /platform:anycpu /nologo /optimize /target:exe /reference:Scoop.Validator.dll,Newtonsoft.Json.dll,Newtonsoft.Json.Schema.dll validator.cs
popd
8 changes: 8 additions & 0 deletions supporting/validator/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# https://github.com/edymtt/nugetstandalone
$destinationFolder = "$psscriptroot\packages"
if ((Test-Path -path $destinationFolder)) {
Remove-Item -Path $destinationFolder -Recurse | Out-Null
}

New-Item $destinationFolder -Type Directory | Out-Null
nuget install packages.config -o $destinationFolder -ExcludeVersion
7 changes: 4 additions & 3 deletions supporting/validator/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json.Schema" version="2.0.8" targetFramework="net45" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" />
<package id="Newtonsoft.Json.Schema" version="3.0.3" targetFramework="net40" />
<package id="Microsoft.Net.Compilers" version="2.3.2" targetFramework="net40" developmentDependency="true" />
</packages>
10 changes: 10 additions & 0 deletions supporting/validator/update.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# https://github.com/edymtt/nugetstandalone
$destinationFolder = "$psscriptroot\packages"
if (!(Test-Path -path $destinationFolder)) {
Write-Host -f Red "Run .\install.ps1 first!"
exit 1
}

nuget update packages.config -r $destinationFolder
Remove-Item $destinationFolder -Force -Recurse | Out-Null
nuget install packages.config -o $destinationFolder -ExcludeVersion
48 changes: 48 additions & 0 deletions supporting/validator/validator.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8EB9B38A-1BAB-4D89-B4CB-ACE5E7C1073B}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Scoop.Validator</RootNamespace>
<AssemblyName>Scoop.Validator</AssemblyName>
<TargetFrameworkVersion>v4.0.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json.Schema, Version=3.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
<HintPath>packages\Newtonsoft.Json.Schema.3.0.3\lib\net40\Newtonsoft.Json.Schema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="validator.cs" />
<Compile Include="Scoop.Validator.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<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>
</PropertyGroup>
<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'))" />
</Target>
</Project>
Binary file modified supporting/validator/validator.exe
Binary file not shown.

0 comments on commit 99820e8

Please sign in to comment.