From 84e322738beb2fc64f90f05985413ae5420ebd8c Mon Sep 17 00:00:00 2001 From: Joel Andres Granados Date: Mon, 9 Sep 2019 16:37:29 +0200 Subject: [PATCH] Update nuget creation to VS2019 (#291) Create visual studio projects that are vs2019 compliant. * nuget_build.ps1 : Introduce a new argument that will define how we implement the nuget build. For now we accept 201{9,7.5.3} as possible argument values. * pugixml_vs2019{,_static}.vcxproj : Add two visual studio projects that build pugi with the latest SDK and build tools * appveyor.yml - Add Visual Studio 2019 to build targets - Add Visual Studio 201{9,3,5} to build_scripts. And call nuget_build.ps1 with a new argument. - Add Visual Studio 2019 to the test_scripts. --- appveyor.yml | 9 +- scripts/nuget/pugixml.nuspec | 2 +- scripts/nuget_build.ps1 | 29 ++++- scripts/pugixml_vs2019.vcxproj | 172 +++++++++++++++++++++++++ scripts/pugixml_vs2019_static.vcxproj | 176 ++++++++++++++++++++++++++ tests/autotest-appveyor.ps1 | 4 + 6 files changed, 383 insertions(+), 9 deletions(-) create mode 100644 scripts/pugixml_vs2019.vcxproj create mode 100644 scripts/pugixml_vs2019_static.vcxproj diff --git a/appveyor.yml b/appveyor.yml index 29295e7..4c636a0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,15 +1,20 @@ image: - - Visual Studio 2015 + - Visual Studio 2019 - Visual Studio 2017 + - Visual Studio 2015 version: "{branch}-{build}" build_script: - - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\scripts\nuget_build.ps1 } + - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2013") { .\scripts\nuget_build.ps1 2013} + - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { .\scripts\nuget_build.ps1 2015} + - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\scripts\nuget_build.ps1 2017} + - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") { .\scripts\nuget_build.ps1 2019} test_script: - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { .\tests\autotest-appveyor.ps1 9 10 11 12 14 } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2017") { .\tests\autotest-appveyor.ps1 15 } + - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2019") { .\tests\autotest-appveyor.ps1 19 } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make config=coverage test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov" } - ps: if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq "Visual Studio 2015") { & C:\cygwin\bin\bash.exe -c "PATH=/usr/bin:/usr/local/bin:$PATH; make config=coverage defines=PUGIXML_WCHAR_MODE test && bash <(curl -s https://codecov.io/bash) -f pugixml.cpp.gcov" } diff --git a/scripts/nuget/pugixml.nuspec b/scripts/nuget/pugixml.nuspec index 931e08c..e6d3cca 100644 --- a/scripts/nuget/pugixml.nuspec +++ b/scripts/nuget/pugixml.nuspec @@ -12,7 +12,7 @@ https://github.com/zeux/pugixml/logo.svg pugixml is a C++ XML processing library, which consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 implementation for complex data-driven tree queries. Full Unicode support is also available, with Unicode interface variants and conversions between different Unicode encodings (which happen automatically during parsing/saving). pugixml is used by a lot of projects, both open-source and proprietary, for performance and easy-to-use interface. -This package contains builds for VS2013, VS2015 and VS2017, for both statically linked and DLL CRT; you can switch the CRT linkage in Project -> Properties -> Referenced Packages -> pugixml. +This package contains builds for VS2013, VS2015 and VS2017, VS2019, for both statically linked and DLL CRT; you can switch the CRT linkage in Project -> Properties -> Referenced Packages -> pugixml. Light-weight, simple and fast XML parser for C++ with XPath support https://pugixml.org/docs/manual.html#changes Copyright (c) 2006-2019 Arseny Kapoulkine diff --git a/scripts/nuget_build.ps1 b/scripts/nuget_build.ps1 index cd11b59..cd18d29 100644 --- a/scripts/nuget_build.ps1 +++ b/scripts/nuget_build.ps1 @@ -34,14 +34,31 @@ cd $scriptdir Force-Copy "../src/pugiconfig.hpp" "nuget/build/native/include/pugiconfig.hpp" Force-Copy "../src/pugixml.hpp" "nuget/build/native/include/pugixml.hpp" -Build-Version "vs2013" "v120" "dynamic" -Build-Version "vs2013" "v120" "static" +if ($args[0] -eq 2019){ + Build-Version "vs2019" "v142" "dynamic" + Build-Version "vs2019" "v142" "static" -Build-Version "vs2015" "v140" "dynamic" -Build-Version "vs2015" "v140" "static" +} elseif ($args[0] -eq 2017){ + Build-Version "vs2017" "v141" "dynamic" + Build-Version "vs2017" "v141" "static" -Build-Version "vs2017" "v141" "dynamic" -Build-Version "vs2017" "v141" "static" + Build-Version "vs2015" "v140" "dynamic" + Build-Version "vs2015" "v140" "static" + + Build-Version "vs2013" "v120" "dynamic" + Build-Version "vs2013" "v120" "static" + +} elseif($args[0] -eq 2015){ + Build-Version "vs2015" "v140" "dynamic" + Build-Version "vs2015" "v140" "static" + + Build-Version "vs2013" "v120" "dynamic" + Build-Version "vs2013" "v120" "static" + +} elseif($args[0] -eq 2013){ + Build-Version "vs2013" "v120" "dynamic" + Build-Version "vs2013" "v120" "static" +} Run-Command "nuget pack nuget" diff --git a/scripts/pugixml_vs2019.vcxproj b/scripts/pugixml_vs2019.vcxproj new file mode 100644 index 0000000..690a790 --- /dev/null +++ b/scripts/pugixml_vs2019.vcxproj @@ -0,0 +1,172 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {07CF01C0-B887-499D-AD9C-799CB6A9FE64} + Win32Proj + pugixml + 10.0 + + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + false + Unicode + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + false + Unicode + + + + + + + + + + + + + + + + + + + + + vs2019\$(Platform)_$(Configuration)\ + vs2019\$(Platform)_$(Configuration)\ + pugixml + + + vs2019\$(Platform)_$(Configuration)\ + vs2019\$(Platform)_$(Configuration)\ + pugixml + + + vs2019\$(Platform)_$(Configuration)\ + vs2019\$(Platform)_$(Configuration)\ + pugixml + + + vs2019\$(Platform)_$(Configuration)\ + vs2019\$(Platform)_$(Configuration)\ + pugixml + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + false + + + Windows + true + + + + + + + Level3 + Disabled + _DEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + false + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + + + Windows + true + true + true + + + + + + + + + + + + + diff --git a/scripts/pugixml_vs2019_static.vcxproj b/scripts/pugixml_vs2019_static.vcxproj new file mode 100644 index 0000000..1747e37 --- /dev/null +++ b/scripts/pugixml_vs2019_static.vcxproj @@ -0,0 +1,176 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {07CF01C0-B887-499D-AD9C-799CB6A9FE64} + Win32Proj + pugixml + 10.0 + + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + false + Unicode + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + false + Unicode + + + + + + + + + + + + + + + + + + + + + vs2019\$(Platform)_$(Configuration)Static\ + vs2019\$(Platform)_$(Configuration)Static\ + pugixml + + + vs2019\$(Platform)_$(Configuration)Static\ + vs2019\$(Platform)_$(Configuration)Static\ + pugixml + + + vs2019\$(Platform)_$(Configuration)Static\ + vs2019\$(Platform)_$(Configuration)Static\ + pugixml + + + vs2019\$(Platform)_$(Configuration)Static\ + vs2019\$(Platform)_$(Configuration)Static\ + pugixml + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + false + MultiThreadedDebug + + + Windows + true + + + + + + + Level3 + Disabled + _DEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + false + MultiThreadedDebug + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + $(IntDir)$(TargetName).pdb + OldStyle + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + + + diff --git a/tests/autotest-appveyor.ps1 b/tests/autotest-appveyor.ps1 index e3805c7..dfed8c5 100644 --- a/tests/autotest-appveyor.ps1 +++ b/tests/autotest-appveyor.ps1 @@ -23,6 +23,10 @@ foreach ($vs in $args) $vsdevcmdarch = if ($arch -eq "x64") { "amd64" } else { "x86" } Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat" "-arch=$vsdevcmdarch" } + elseif ($vs -eq 19){ + $vsdevcmdarch = if ($arch -eq "x64") { "amd64" } else { "x86" } + Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" "-arch=$vsdevcmdarch" + } else { Invoke-CmdScript "C:\Program Files (x86)\Microsoft Visual Studio $vs.0\VC\vcvarsall.bat" $arch