From 0c0f68939e0d8367e55793f80f0000f2a43a812a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 4 Apr 2018 01:45:45 -0700 Subject: Introduce "vcpkg fetch" --- toolsrc/include/vcpkg/commands.h | 7 +++++++ toolsrc/include/vcpkg/vcpkgpaths.h | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h index 7369b8206..f6f1de626 100644 --- a/toolsrc/include/vcpkg/commands.h +++ b/toolsrc/include/vcpkg/commands.h @@ -135,6 +135,13 @@ namespace vcpkg::Commands std::string get_file_hash(const VcpkgPaths& paths, fs::path const& path, std::string const& hash_type); } + namespace Fetch + { + std::vector find_toolset_instances(const VcpkgPaths& paths); + fs::path get_tool_path(const VcpkgPaths& paths, const std::string& tool); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + template struct PackageNameAndFunction { diff --git a/toolsrc/include/vcpkg/vcpkgpaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h index b3f24fb89..090414de3 100644 --- a/toolsrc/include/vcpkg/vcpkgpaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -7,8 +7,22 @@ #include #include +#include + namespace vcpkg { + namespace Tools + { + static const std::string SEVEN_ZIP = "7zip"; + static const std::string CMAKE = "cmake"; + static const std::string GIT = "git"; + static const std::string NINJA = "ninja"; + static const std::string NUGET = "nuget"; + static const std::string IFW_INSTALLER_BASE = "ifw_installerbase"; + static const std::string IFW_BINARYCREATOR = "ifw_binarycreator"; + static const std::string IFW_REPOGEN = "ifw_repogen"; + } + struct ToolsetArchOption { CStringView name; @@ -63,14 +77,7 @@ namespace vcpkg fs::path ports_cmake; - const fs::path& get_7za_exe() const; - const fs::path& get_cmake_exe() const; - const fs::path& get_git_exe() const; - const fs::path& get_ninja_exe() const; - const fs::path& get_nuget_exe() const; - const fs::path& get_ifw_installerbase_exe() const; - const fs::path& get_ifw_binarycreator_exe() const; - const fs::path& get_ifw_repogen_exe() const; + const fs::path& get_tool_exe(const std::string& tool) const; /// Retrieve a toolset matching a VS version /// @@ -82,14 +89,7 @@ namespace vcpkg private: Lazy> available_triplets; - Lazy _7za_exe; - Lazy cmake_exe; - Lazy git_exe; - Lazy ninja_exe; - Lazy nuget_exe; - Lazy ifw_installerbase_exe; - Lazy ifw_binarycreator_exe; - Lazy ifw_repogen_exe; + mutable std::map tool_paths; Lazy> toolsets; Lazy> toolsets_vs2013; -- cgit v1.2.3