From 92cf32d59a5b3a1fd68bce4edf5c5d576e637678 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 10 Apr 2017 12:57:49 -0700 Subject: Add skeleton code for `vcpkg export` --- toolsrc/include/vcpkg_Commands.h | 5 +++++ toolsrc/include/vcpkg_Dependencies.h | 26 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 9760b5a35..68689bf1e 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -65,6 +65,11 @@ namespace vcpkg::Commands void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } + namespace Export + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + } + namespace CI { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 247113573..ec3759a64 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -73,7 +73,33 @@ namespace vcpkg::Dependencies RequestType request_type; }; + enum class ExportPlanType + { + UNKNOWN, + PORT_AVAILABLE_BUT_NOT_BUILT, + ALREADY_BUILT + }; + + struct ExportPlanAction + { + static bool compare_by_name(const ExportPlanAction* left, const ExportPlanAction* right); + + ExportPlanAction(); + ExportPlanAction(const PackageSpec& spec, const AnyParagraph& any_paragraph, const RequestType& request_type); + ExportPlanAction(const ExportPlanAction&) = delete; + ExportPlanAction(ExportPlanAction&&) = default; + ExportPlanAction& operator=(const ExportPlanAction&) = delete; + ExportPlanAction& operator=(ExportPlanAction&&) = default; + + PackageSpec spec; + AnyParagraph any_paragraph; + ExportPlanType plan_type; + RequestType request_type; + }; + std::vector create_install_plan(const VcpkgPaths& paths, const std::vector& specs, const StatusParagraphs& status_db); std::vector create_remove_plan(const std::vector& specs, const StatusParagraphs& status_db); + + std::vector create_export_plan(const VcpkgPaths& paths, const std::vector& specs, const StatusParagraphs& status_db); } -- cgit v1.2.3