From 3f76b9e53d48e34960bb5947bbbb880ac806281b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 3 Apr 2017 16:29:11 -0700 Subject: vcpkg_paths -> VcpkgPaths --- toolsrc/include/Paragraphs.h | 4 +-- toolsrc/include/PostBuildLint.h | 4 +-- toolsrc/include/VcpkgPaths.h | 58 ++++++++++++++++++++++++++++++++++++ toolsrc/include/vcpkg_Commands.h | 50 +++++++++++++++---------------- toolsrc/include/vcpkg_Dependencies.h | 4 +-- toolsrc/include/vcpkg_Input.h | 4 +-- toolsrc/include/vcpkg_paths.h | 58 ------------------------------------ toolsrc/include/vcpkglib.h | 8 ++--- 8 files changed, 95 insertions(+), 95 deletions(-) create mode 100644 toolsrc/include/VcpkgPaths.h delete mode 100644 toolsrc/include/vcpkg_paths.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index f466741c4..610ebbad6 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -4,7 +4,7 @@ #include #include "vcpkg_expected.h" #include "BinaryParagraph.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" #include "VersionT.h" namespace vcpkg::Paragraphs @@ -18,7 +18,7 @@ namespace vcpkg::Paragraphs Expected try_load_port(const fs::path& control_path); - Expected try_load_cached_package(const vcpkg_paths& paths, const PackageSpec& spec); + Expected try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec); std::vector load_all_ports(const fs::path& ports_dir); diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/PostBuildLint.h index 1f96b02f1..b8afdd5a6 100644 --- a/toolsrc/include/PostBuildLint.h +++ b/toolsrc/include/PostBuildLint.h @@ -1,8 +1,8 @@ #pragma once #include "PackageSpec.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" namespace vcpkg::PostBuildLint { - size_t perform_all_checks(const PackageSpec& spec, const vcpkg_paths& paths); + size_t perform_all_checks(const PackageSpec& spec, const VcpkgPaths& paths); } diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/VcpkgPaths.h new file mode 100644 index 000000000..880b33b98 --- /dev/null +++ b/toolsrc/include/VcpkgPaths.h @@ -0,0 +1,58 @@ +#pragma once +#include "filesystem_fs.h" +#include "vcpkg_expected.h" +#include "PackageSpec.h" +#include "BinaryParagraph.h" +#include "Lazy.h" + +namespace vcpkg +{ + struct Toolset + { + fs::path dumpbin; + fs::path vcvarsall; + CWStringView version; + }; + + struct VcpkgPaths + { + static Expected create(const fs::path& vcpkg_root_dir); + + fs::path package_dir(const PackageSpec& spec) const; + fs::path port_dir(const PackageSpec& spec) const; + fs::path build_info_file_path(const PackageSpec& spec) const; + fs::path listfile_path(const BinaryParagraph& pgh) const; + + bool is_valid_triplet(const Triplet& t) const; + + fs::path root; + fs::path packages; + fs::path buildtrees; + fs::path downloads; + fs::path ports; + fs::path installed; + fs::path triplets; + fs::path scripts; + + fs::path buildsystems; + fs::path buildsystems_msbuild_targets; + + fs::path vcpkg_dir; + fs::path vcpkg_dir_status_file; + fs::path vcpkg_dir_info; + fs::path vcpkg_dir_updates; + + fs::path ports_cmake; + + const fs::path& get_cmake_exe() const; + const fs::path& get_git_exe() const; + const fs::path& get_nuget_exe() const; + const Toolset& get_toolset() const; + + private: + Lazy cmake_exe; + Lazy git_exe; + Lazy nuget_exe; + Lazy toolset; + }; +} diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 6adfb5656..227c44379 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -1,15 +1,15 @@ #pragma once #include "VcpkgCmdArguments.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" #include "StatusParagraphs.h" #include #include "VersionT.h" namespace vcpkg::Commands { - using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); - using CommandTypeB = void(*)(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); + using CommandTypeB = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); using CommandTypeC = void(*)(const VcpkgCmdArguments& args); namespace Build @@ -31,30 +31,30 @@ namespace vcpkg::Commands std::wstring make_build_env_cmd(const Triplet& target_triplet, const Toolset& toolset); - BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); - void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set& options, const vcpkg_paths& paths); - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); + BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const VcpkgPaths& paths, const fs::path& port_dir, const StatusParagraphs& status_db); + void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set& options, const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); } namespace BuildExternal { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); } namespace Install { - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db); - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); + void install_package(const VcpkgPaths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); } namespace CI { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); } namespace Remove { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet); } namespace Update @@ -67,67 +67,67 @@ namespace vcpkg::Commands VersionDiff version_diff; }; - std::vector find_outdated_packages(const vcpkg_paths& paths, const StatusParagraphs& status_db); - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + std::vector find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Env { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_triplet); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); } namespace Create { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Edit { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Search { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace List { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Owns { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Cache { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Import { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Integrate { extern const char*const INTEGRATE_COMMAND_HELPSTRING; - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace PortsDiff { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); } namespace Help { - void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - void help_topic_valid_triplet(const vcpkg_paths& paths); + void help_topic_valid_triplet(const VcpkgPaths& paths); void print_usage(); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index f04c41574..289df88dd 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -2,7 +2,7 @@ #include #include "PackageSpec.h" #include "StatusParagraphs.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" #include "vcpkg_optional.h" namespace vcpkg::Dependencies @@ -73,7 +73,7 @@ namespace vcpkg::Dependencies RemovePlanAction plan; }; - std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + 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); } diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 5e1d1f0fa..fd549f278 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -1,7 +1,7 @@ #pragma once #include #include "PackageSpec.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" namespace vcpkg::Input { @@ -10,5 +10,5 @@ namespace vcpkg::Input const Triplet& default_target_triplet, CStringView example_text); - void check_triplet(const Triplet& t, const vcpkg_paths& paths); + void check_triplet(const Triplet& t, const VcpkgPaths& paths); } diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h deleted file mode 100644 index bc966ac6d..000000000 --- a/toolsrc/include/vcpkg_paths.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once -#include "filesystem_fs.h" -#include "vcpkg_expected.h" -#include "PackageSpec.h" -#include "BinaryParagraph.h" -#include "Lazy.h" - -namespace vcpkg -{ - struct Toolset - { - fs::path dumpbin; - fs::path vcvarsall; - CWStringView version; - }; - - struct vcpkg_paths - { - static Expected create(const fs::path& vcpkg_root_dir); - - fs::path package_dir(const PackageSpec& spec) const; - fs::path port_dir(const PackageSpec& spec) const; - fs::path build_info_file_path(const PackageSpec& spec) const; - fs::path listfile_path(const BinaryParagraph& pgh) const; - - bool is_valid_triplet(const Triplet& t) const; - - fs::path root; - fs::path packages; - fs::path buildtrees; - fs::path downloads; - fs::path ports; - fs::path installed; - fs::path triplets; - fs::path scripts; - - fs::path buildsystems; - fs::path buildsystems_msbuild_targets; - - fs::path vcpkg_dir; - fs::path vcpkg_dir_status_file; - fs::path vcpkg_dir_info; - fs::path vcpkg_dir_updates; - - fs::path ports_cmake; - - const fs::path& get_cmake_exe() const; - const fs::path& get_git_exe() const; - const fs::path& get_nuget_exe() const; - const Toolset& get_toolset() const; - - private: - Lazy cmake_exe; - Lazy git_exe; - Lazy nuget_exe; - Lazy toolset; - }; -} diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h index 6acfb6227..f4803ceaa 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkglib.h @@ -1,16 +1,16 @@ #pragma once #include "StatusParagraphs.h" -#include "vcpkg_paths.h" +#include "VcpkgPaths.h" #include "SortedVector.h" namespace vcpkg { extern bool g_debugging; - StatusParagraphs database_load_check(const vcpkg_paths& paths); + StatusParagraphs database_load_check(const VcpkgPaths& paths); - void write_update(const vcpkg_paths& paths, const StatusParagraph& p); + void write_update(const VcpkgPaths& paths, const StatusParagraph& p); struct StatusParagraph_and_associated_files { @@ -19,7 +19,7 @@ namespace vcpkg }; std::vector get_installed_ports(const StatusParagraphs& status_db); - std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + std::vector get_installed_files(const VcpkgPaths& paths, const StatusParagraphs& status_db); struct CMakeVariable -- cgit v1.2.3