Use nlohmann.json NuGet package instead of direct file

This way it will be easier to update to new version (when released).
And it will be also clear that we have dependency on this 3rd party
library.
This commit is contained in:
ge0rdi
2023-07-26 12:05:44 +02:00
parent 8f26cae3f0
commit f897241a08
6 changed files with 22 additions and 24598 deletions

View File

@@ -13,7 +13,7 @@
#include "FNVHash.h"
#include "StringUtils.h"
#include "Translations.h"
#include "json.hpp"
#include <nlohmann/json.hpp>
#include <wininet.h>
#include <softpub.h>

View File

@@ -101,7 +101,17 @@
<ClCompile Include="TrackResources.cpp" />
<ClCompile Include="Translations.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets" Condition="Exists('..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use 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\nlohmann.json.3.11.2\build\native\nlohmann.json.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\nlohmann.json.3.11.2\build\native\nlohmann.json.targets'))" />
</Target>
</Project>

View File

@@ -149,4 +149,7 @@
<Filter>Lib</Filter>
</ClCompile>
</ItemGroup>
</Project>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

4
Src/Lib/packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nlohmann.json" version="3.11.2" targetFramework="native" />
</packages>

View File

@@ -6,6 +6,9 @@ echo -- Compiling
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
REM Restore NuGet packages
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Restore -p:RestorePackagesConfig=true /verbosity:quiet /nologo
REM ********* Build 64-bit solution
echo --- 64bit
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="x64" /verbosity:quiet /nologo