From 135f91de1eef9e906eb7a5bcf323f6eff9a2b5da Mon Sep 17 00:00:00 2001 From: ras0219 Date: Wed, 1 Jul 2020 11:36:09 -0700 Subject: [vcpkg] Implement --x-write-nuget-packages-config= setting for `install` and `x-set-installed` (#12138) * [vcpkg] Implement --x-write-nuget-packages-config= setting for `install` and `x-set-installed`. * [vcpkg] Add end-to-end testing suite for install, remove, and binary caching * [vcpkg] Define `$TestingRoot in end-to-end-tests.ps1 * [vcpkg] Address CR comments Co-authored-by: Robert Schumacher --- toolsrc/include/vcpkg/base/files.h | 4 ++++ toolsrc/include/vcpkg/binarycaching.h | 5 +++-- toolsrc/include/vcpkg/binarycaching.private.h | 11 ++++++++--- toolsrc/include/vcpkg/commands.h | 3 ++- 4 files changed, 17 insertions(+), 6 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index dce9584fa..7676b49a0 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -201,4 +201,8 @@ namespace vcpkg::Files bool has_invalid_chars_for_filesystem(const std::string& s); void print_paths(const std::vector& paths); + + /// Performs "lhs / rhs" according to the C++17 Filesystem Library Specification. + /// This function exists as a workaround for TS implementations. + fs::path combine(const fs::path& lhs, const fs::path& rhs); } diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h index 61af79a3f..c1db1f169 100644 --- a/toolsrc/include/vcpkg/binarycaching.h +++ b/toolsrc/include/vcpkg/binarycaching.h @@ -39,8 +39,7 @@ namespace vcpkg virtual void push_failure(const VcpkgPaths& paths, const std::string& abi_tag, const PackageSpec& spec) = 0; /// Requests the result of `try_restore()` without actually downloading the package. Used by CI to determine /// missing packages. - virtual RestoreResult precheck(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action) = 0; + virtual RestoreResult precheck(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0; }; IBinaryProvider& null_binary_provider(); @@ -50,5 +49,7 @@ namespace vcpkg ExpectedS> create_binary_provider_from_configs_pure(const std::string& env_string, View args); + std::string generate_nuget_packages_config(const Dependencies::ActionPlan& action); + void help_topic_binary_caching(const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg/binarycaching.private.h b/toolsrc/include/vcpkg/binarycaching.private.h index f1fd046de..f20a0db12 100644 --- a/toolsrc/include/vcpkg/binarycaching.private.h +++ b/toolsrc/include/vcpkg/binarycaching.private.h @@ -36,9 +36,6 @@ namespace vcpkg struct XmlSerializer { - std::string buf; - int indent = 0; - XmlSerializer& emit_declaration(); XmlSerializer& open_tag(StringLiteral sl); XmlSerializer& start_complex_open_tag(StringLiteral sl); @@ -49,6 +46,14 @@ namespace vcpkg XmlSerializer& text(StringView sv); XmlSerializer& simple_tag(StringLiteral tag, StringView content); XmlSerializer& line_break(); + + std::string buf; + + private: + XmlSerializer& emit_pending_indent(); + + int m_indent = 0; + bool m_pending_indent = false; }; } \ No newline at end of file diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index b73e91fe7..cec9237f5 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -163,7 +163,8 @@ namespace vcpkg::Commands const CMakeVars::CMakeVarProvider& cmake_vars, const std::vector& specs, const Build::BuildPackageOptions& install_plan_options, - DryRun dry_run); + DryRun dry_run, + const Optional& pkgsconfig_path); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); } -- cgit v1.2.3