aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-04-04 01:45:45 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-04-06 17:24:46 -0700
commit0c0f68939e0d8367e55793f80f0000f2a43a812a (patch)
tree9c7456dac30c2af53f982a7a4791cd790caa4e50 /toolsrc/include
parent54c68da907e4881d29e8017e085e6786e1c34ace (diff)
downloadvcpkg-0c0f68939e0d8367e55793f80f0000f2a43a812a.tar.gz
vcpkg-0c0f68939e0d8367e55793f80f0000f2a43a812a.zip
Introduce "vcpkg fetch"
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/commands.h7
-rw-r--r--toolsrc/include/vcpkg/vcpkgpaths.h32
2 files changed, 23 insertions, 16 deletions
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<Toolset> 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<class T>
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 <vcpkg/base/files.h>
#include <vcpkg/base/lazy.h>
+#include <map>
+
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;
/// <summary>Retrieve a toolset matching a VS version</summary>
/// <remarks>
@@ -82,14 +89,7 @@ namespace vcpkg
private:
Lazy<std::vector<std::string>> available_triplets;
- Lazy<fs::path> _7za_exe;
- Lazy<fs::path> cmake_exe;
- Lazy<fs::path> git_exe;
- Lazy<fs::path> ninja_exe;
- Lazy<fs::path> nuget_exe;
- Lazy<fs::path> ifw_installerbase_exe;
- Lazy<fs::path> ifw_binarycreator_exe;
- Lazy<fs::path> ifw_repogen_exe;
+ mutable std::map<std::string, fs::path> tool_paths;
Lazy<std::vector<Toolset>> toolsets;
Lazy<std::vector<Toolset>> toolsets_vs2013;