From 2b8bdeb0441c9fb83fc79bf10a761d1bf11cd287 Mon Sep 17 00:00:00 2001 From: sdcb Date: Thu, 20 Oct 2016 13:03:58 +0800 Subject: Add hash file support. --- toolsrc/include/vcpkg_Commands.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 978519820..dc4699dc0 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -35,6 +35,7 @@ namespace vcpkg void version_command(const vcpkg_cmd_arguments& args); void contact_command(const vcpkg_cmd_arguments& args); + void hash_command(const vcpkg_cmd_arguments& args); using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); -- cgit v1.2.3 From c12c3d90bee810abaec479c49d889957b52151db Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 20 Oct 2016 18:05:52 -0700 Subject: src Formatting --- toolsrc/include/vcpkg_Commands.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index dc4699dc0..3cc48ac89 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -35,7 +35,7 @@ namespace vcpkg void version_command(const vcpkg_cmd_arguments& args); void contact_command(const vcpkg_cmd_arguments& args); - void hash_command(const vcpkg_cmd_arguments& args); + void hash_command(const vcpkg_cmd_arguments& args); using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); -- cgit v1.2.3 From 8a97f05d92a34589e1cf87865d0e0b5394ac05b3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:33:11 -0700 Subject: [Maps] Add function extract_keys() --- toolsrc/include/vcpkg_Maps.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index 5b7b8ed46..886889294 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -15,4 +15,15 @@ namespace vcpkg { namespace Maps } return key_set; } + + template + std::vector extract_keys(const std::unordered_map& input_map) + { + std::vector key_set; + for (auto const& element : input_map) + { + key_set.push_back(element.first); + } + return key_set; + } }} -- cgit v1.2.3 From 87a78a78dcb88d1656eda5dcbdf306fb55eba575 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 19:34:30 -0700 Subject: [Strings] Add join() --- toolsrc/include/vcpkg_Strings.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 70526198c..d55a01224 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg {namespace Strings {namespace details { @@ -67,4 +68,6 @@ namespace vcpkg {namespace Strings std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern); std::string ascii_to_lowercase(const std::string& input); + + std::string join(const std::vector& v, const std::string& delimiter); }} -- cgit v1.2.3 From 4665b16ab3556235ddcbdac160df261ee87694e4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 2 Nov 2016 20:26:52 -0700 Subject: Add checks for fields in CONTROL file. Resolves #228 --- toolsrc/include/SourceParagraph.h | 5 ++++- toolsrc/include/vcpkglib_helpers.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 72dca8324..a8ad13668 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,14 +7,17 @@ namespace vcpkg { struct SourceParagraph { + static const std::vector& get_list_of_valid_entries(); + SourceParagraph(); - explicit SourceParagraph(const std::unordered_map& fields); + explicit SourceParagraph(std::unordered_map fields); std::string name; std::string version; std::string description; std::string maintainer; std::vector depends; + std::unordered_map unparsed_fields; }; } diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 72711d63b..05c9e17df 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -5,8 +5,10 @@ namespace vcpkg {namespace details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname); + std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname); std::string required_field(const std::unordered_map& fields, const std::string& fieldname); + std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); std::vector parse_depends(const std::string& depends_string); }} -- cgit v1.2.3 From 5b60e134665cdb33bd1f01f17e61c5b9ba4ad137 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 14:34:52 -0700 Subject: [SourceParagraph] Consistency rename --- toolsrc/include/SourceParagraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index a8ad13668..6aae81872 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,7 +7,7 @@ namespace vcpkg { struct SourceParagraph { - static const std::vector& get_list_of_valid_entries(); + static const std::vector& get_list_of_valid_fields(); SourceParagraph(); -- cgit v1.2.3 From 90876a3bfef586a20e475d5ef812bac843e7a1a8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 15:43:09 -0700 Subject: SourceParagraph checks fields at construction time --- toolsrc/include/SourceParagraph.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 6aae81872..9c9439ea7 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -18,6 +18,5 @@ namespace vcpkg std::string description; std::string maintainer; std::vector depends; - std::unordered_map unparsed_fields; }; } -- cgit v1.2.3 From 95ef1b95e6e2f7933bb40f428514dcf178b201e6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 17:36:47 -0700 Subject: [BinaryParagraph] Refactor implementation --- toolsrc/include/BinaryParagraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index 01979c924..dcb986423 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -10,7 +10,7 @@ namespace vcpkg struct BinaryParagraph { BinaryParagraph(); - explicit BinaryParagraph(const std::unordered_map& fields); + explicit BinaryParagraph(std::unordered_map fields); BinaryParagraph(const SourceParagraph& spgh, const triplet& target_triplet); std::string displayname() const; -- cgit v1.2.3 From 11c9a523f7cd8cc324606c543311de1edcaee6cb Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 3 Nov 2016 18:52:44 -0700 Subject: [SourceParagraph] Make function static --- toolsrc/include/SourceParagraph.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index 9c9439ea7..bac005144 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -7,8 +7,6 @@ namespace vcpkg { struct SourceParagraph { - static const std::vector& get_list_of_valid_fields(); - SourceParagraph(); explicit SourceParagraph(std::unordered_map fields); -- cgit v1.2.3 From 7f336c746776daf2af95914ed25ff3d50a96b387 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 5 Nov 2016 01:02:15 -0700 Subject: Enable qualified dependencies. Fix bug in internal 'build' command. Added capability for CONTROL files to specify qualified dependencies, which are substring searched inside triplet names. Fixed bug in internal 'build' command where if a package is already built, that built package's dependencies will be used to determine requirements for the build instead of the port directory's CONTROL file. --- toolsrc/include/SourceParagraph.h | 17 ++++++++++++++++- toolsrc/include/vcpkg.h | 1 + toolsrc/include/vcpkg_Dependencies.h | 2 +- toolsrc/include/vcpkglib_helpers.h | 2 -- 4 files changed, 18 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index bac005144..5ae9b38b8 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -5,6 +5,16 @@ namespace vcpkg { + struct triplet; + + struct dependency + { + std::string name; + std::string qualifier; + }; + + std::ostream& operator<<(std::ostream& os, const dependency& p); + struct SourceParagraph { SourceParagraph(); @@ -15,6 +25,11 @@ namespace vcpkg std::string version; std::string description; std::string maintainer; - std::vector depends; + std::vector depends; }; + + std::vector filter_dependencies(const std::vector& deps, const triplet& t); + + std::vector expand_qualified_dependencies(const std::vector& depends); + std::vector parse_depends(const std::string& depends_string); } diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index a4a0682cf..dc5933f10 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -21,6 +21,7 @@ namespace vcpkg StatusParagraphs database_load_check(const vcpkg_paths& paths); std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9dc32fc41..94aa51f99 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,5 +9,5 @@ namespace vcpkg {namespace Dependencies { std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 05c9e17df..640fab555 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -9,6 +9,4 @@ namespace vcpkg {namespace details std::string required_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); - - std::vector parse_depends(const std::string& depends_string); }} -- cgit v1.2.3 From 83ffbf028f8a77bfab23328aa8f2280db5539329 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:11:50 -0800 Subject: [Maps] Add overload for map (existing: unordered_map) --- toolsrc/include/vcpkg_Maps.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index 886889294..c67462a39 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -2,6 +2,7 @@ #include #include +#include namespace vcpkg { namespace Maps { @@ -26,4 +27,15 @@ namespace vcpkg { namespace Maps } return key_set; } + + template + std::vector extract_keys(const std::map& input_map) + { + std::vector key_set; + for (auto const& element : input_map) + { + key_set.push_back(element.first); + } + return key_set; + } }} -- cgit v1.2.3 From e4cab414aee77b03140d0198ce8c0756c46b5c0a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Sun, 6 Nov 2016 20:12:54 -0800 Subject: Add new command: portsdiff --- toolsrc/include/vcpkg_Commands.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 3cc48ac89..8272929a7 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -30,6 +30,8 @@ namespace vcpkg void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void help_topic_valid_triplet(const vcpkg_paths& paths); -- cgit v1.2.3 From a721db2c1fbfc1b87065b0b43e32249117e53242 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:06:36 -0800 Subject: Refactor: create new Paragraphs.h/cpp --- toolsrc/include/Paragraphs.h | 11 +++++++++++ toolsrc/include/vcpkg.h | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/Paragraphs.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h new file mode 100644 index 000000000..22aaefe98 --- /dev/null +++ b/toolsrc/include/Paragraphs.h @@ -0,0 +1,11 @@ +#pragma once + +#include +#include + +namespace vcpkg { namespace Paragraphs +{ + namespace fs = std::tr2::sys; + std::vector> get_paragraphs(const fs::path& control_path); + std::vector> parse_paragraphs(const std::string& str); +}} diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index dc5933f10..1715a40a5 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -14,8 +14,6 @@ namespace vcpkg extern bool g_do_dry_run; - std::vector> get_paragraphs(const fs::path& control_path); - std::vector> parse_paragraphs(const std::string& str); std::string shorten_description(const std::string& desc); StatusParagraphs database_load_check(const vcpkg_paths& paths); -- cgit v1.2.3 From d65e78f6f5005c08832668a8f713d1f678c49b7c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:17:34 -0800 Subject: Move functions that are only used by `import` out of vcpkg.h/cpp --- toolsrc/include/vcpkg.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 1715a40a5..4e284241d 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -26,7 +26,5 @@ namespace vcpkg void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); - void binary_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data); - const std::string& version(); } // namespace vcpkg -- cgit v1.2.3 From 8be5e7c123d241cd4a71d03acdf43ceccf57ded2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 16:38:49 -0800 Subject: Move Dependency-related functions from vcpkg.h to vcpkg_Dependencies.h --- toolsrc/include/vcpkg.h | 4 ---- toolsrc/include/vcpkg_Dependencies.h | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 4e284241d..b9d646e70 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include #include "package_spec.h" #include "BinaryParagraph.h" @@ -18,9 +17,6 @@ namespace vcpkg StatusParagraphs database_load_check(const vcpkg_paths& paths); - std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 94aa51f99..d8d331f9c 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -10,4 +10,7 @@ namespace vcpkg {namespace Dependencies std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} -- cgit v1.2.3 From d85e169c054c0702ec6cd2deedff58eaf49dcfab Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:05:32 -0800 Subject: [Dependencies] Make function static --- toolsrc/include/vcpkg_Dependencies.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index d8d331f9c..d8709e0bb 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -11,6 +11,5 @@ namespace vcpkg {namespace Dependencies std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::vector get_unmet_package_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} -- cgit v1.2.3 From 21f69a44bead8c4ffe6719131172512519afe3aa Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:06:46 -0800 Subject: [Dependencies] Function rename --- toolsrc/include/vcpkg_Dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index d8709e0bb..556ac8750 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,7 +9,7 @@ namespace vcpkg {namespace Dependencies { std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::unordered_set find_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); }} -- cgit v1.2.3 From 7a1bc07142577cce32ee88c8d8ef60b386d19b6a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:09:07 -0800 Subject: [Dependencies] Remove unused parameter --- toolsrc/include/vcpkg_Dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 556ac8750..8e6808ee3 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -11,5 +11,5 @@ namespace vcpkg {namespace Dependencies std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec, const StatusParagraphs& status_db); + std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec); }} -- cgit v1.2.3 From c91d8e41b60653b652b11c641f7a5b3d3eab7f6b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:31:41 -0800 Subject: Introduce vcpkg_info.h/cpp --- toolsrc/include/vcpkg.h | 2 -- toolsrc/include/vcpkg_info.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/vcpkg_info.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index b9d646e70..30d8adbf8 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -21,6 +21,4 @@ namespace vcpkg void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); - - const std::string& version(); } // namespace vcpkg diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h new file mode 100644 index 000000000..01da06307 --- /dev/null +++ b/toolsrc/include/vcpkg_info.h @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace vcpkg { namespace Info +{ + const std::string& version(); + + const std::string& email(); +}} -- cgit v1.2.3 From d78c1a974f1eabe8caf5df36bbd5b55b2dcd701d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:37:08 -0800 Subject: Move shorten_description to vcpkglib_helpers --- toolsrc/include/vcpkg.h | 2 -- toolsrc/include/vcpkglib_helpers.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 30d8adbf8..3a8160c71 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -13,8 +13,6 @@ namespace vcpkg extern bool g_do_dry_run; - std::string shorten_description(const std::string& desc); - StatusParagraphs database_load_check(const vcpkg_paths& paths); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 640fab555..019bb8c39 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -9,4 +9,6 @@ namespace vcpkg {namespace details std::string required_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); + + std::string shorten_description(const std::string& desc); }} -- cgit v1.2.3 From be25fd7331c5920eec76cdfdfaeb1a869627afb8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:51:23 -0800 Subject: Remove unused #include --- toolsrc/include/BinaryParagraph.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index dcb986423..3d9cfb9fb 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -2,7 +2,6 @@ #include #include "SourceParagraph.h" -#include "triplet.h" #include "package_spec.h" namespace vcpkg -- cgit v1.2.3 From d799762ea7a8e6790d06bfc64297f9896e12c3b4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:54:23 -0800 Subject: Move listfile_path() to vcpkg_paths.h --- toolsrc/include/vcpkg_paths.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 046b6836c..8276242e9 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -2,6 +2,7 @@ #include #include "expected.h" #include "package_spec.h" +#include "BinaryParagraph.h" namespace vcpkg { @@ -13,6 +14,7 @@ namespace vcpkg fs::path package_dir(const package_spec& spec) const; fs::path port_dir(const package_spec& spec) const; + fs::path listfile_path(const BinaryParagraph& pgh) const; bool is_valid_triplet(const triplet& t) const; fs::path root; -- cgit v1.2.3 From 1a1507a6039ce44220447d2b1ab723d631515b07 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:56:40 -0800 Subject: Move search_file() to commands_own.cpp --- toolsrc/include/vcpkg.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 3a8160c71..0797f7f74 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -17,6 +17,4 @@ namespace vcpkg void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); - - void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db); } // namespace vcpkg -- cgit v1.2.3 From eaebe2888ab97de74200904807ae884419ccc195 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 7 Nov 2016 17:57:03 -0800 Subject: Remove unused #include directive --- toolsrc/include/vcpkg.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 0797f7f74..1d7f87d32 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "package_spec.h" #include "BinaryParagraph.h" #include "StatusParagraphs.h" -- cgit v1.2.3 From 6e9d17f73c01c3ad07875ca79196ed2f5e2d3896 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 8 Nov 2016 14:12:49 -0800 Subject: Introduce BUILD_INFO file. Significant change in the way static/dynamic is handled --- toolsrc/include/BuildInfo.h | 28 ++++++++++++++++++++++++++++ toolsrc/include/triplet.h | 8 -------- toolsrc/include/vcpkg_paths.h | 2 ++ 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 toolsrc/include/BuildInfo.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h new file mode 100644 index 000000000..2801cf49d --- /dev/null +++ b/toolsrc/include/BuildInfo.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include "Paragraphs.h" + +namespace fs = std::tr2::sys; + +namespace vcpkg +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + struct BuildInfo + { + static BuildInfo create(const std::unordered_map& pgh); + + std::string crt_linkage; + std::string library_linkage; + }; + + BuildInfo read_build_info(const fs::path& filepath); +} diff --git a/toolsrc/include/triplet.h b/toolsrc/include/triplet.h index bc99a17df..32ea2e711 100644 --- a/toolsrc/include/triplet.h +++ b/toolsrc/include/triplet.h @@ -8,20 +8,12 @@ namespace vcpkg { static triplet from_canonical_name(const std::string& triplet_as_string); - enum class BuildType - { - DYNAMIC, - STATIC - }; - static const triplet X86_WINDOWS; static const triplet X64_WINDOWS; static const triplet X86_UWP; static const triplet X64_UWP; static const triplet ARM_UWP; - BuildType build_type() const; - const std::string& canonical_name() const; std::string architecture() const; diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 8276242e9..2dc9c7636 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -14,7 +14,9 @@ namespace vcpkg fs::path package_dir(const package_spec& spec) const; fs::path port_dir(const package_spec& spec) const; + fs::path build_info_file_path(const package_spec& spec) const; fs::path listfile_path(const BinaryParagraph& pgh) const; + bool is_valid_triplet(const triplet& t) const; fs::path root; -- cgit v1.2.3 From 89447c156d3b99ba63499aa4b8f23b985ccd6474 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 01:27:49 -0800 Subject: Add checks for crt linkage (currently disabled) --- toolsrc/include/BuildInfo.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 2801cf49d..870001474 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -16,6 +16,42 @@ namespace vcpkg LinkageType linkage_type_value_of(const std::string& as_string); + std::string to_string(const LinkageType& build_info); + + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); + + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + const ConfigurationType config; + const LinkageType linkage; + + BuildType() = delete; + + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage) : config(config), linkage(linkage) + { + } + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); + struct BuildInfo { static BuildInfo create(const std::unordered_map& pgh); -- cgit v1.2.3 From bf7978dcf962c8ff37b3319121e60eb1629be684 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 9 Nov 2016 18:44:11 -0800 Subject: [post-build-checks] Rework crt linkage checks --- toolsrc/include/BuildInfo.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 870001474..235c83837 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -2,6 +2,7 @@ #include #include "Paragraphs.h" +#include namespace fs = std::tr2::sys; @@ -35,17 +36,33 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - const ConfigurationType config; - const LinkageType linkage; + static constexpr int length() + { + return 4; + } + + static const std::vector& values() + { + static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; + return v; + } BuildType() = delete; - std::string toString() const; + const ConfigurationType& config() const; + const LinkageType& linkage() const; + const std::regex& crt_regex() const; + const std::string& toString() const; private: - BuildType(const ConfigurationType& config, const LinkageType& linkage) : config(config), linkage(linkage) + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) { } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; }; bool operator ==(const BuildType& lhs, const BuildType& rhs); -- cgit v1.2.3 From eb7ca47d4839a6bf8cea36cba8507750cd5d7746 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 11:04:33 -0800 Subject: Add checks for outdated crts --- toolsrc/include/BuildInfo.h | 42 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 5 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 235c83837..5a85d92d8 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -36,11 +36,6 @@ namespace vcpkg static const BuildType RELEASE_STATIC; static const BuildType RELEASE_DYNAMIC; - static constexpr int length() - { - return 4; - } - static const std::vector& values() { static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; @@ -69,6 +64,43 @@ namespace vcpkg bool operator !=(const BuildType& lhs, const BuildType& rhs); + struct OutdatedDynamicCrt + { + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, MSVCP_WIN_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + const std::regex& crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) + { + } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; + struct BuildInfo { static BuildInfo create(const std::unordered_map& pgh); -- cgit v1.2.3 From d852d3b6f230a55878d7be26fba210cfc67689d1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 10 Nov 2016 16:28:10 -0800 Subject: Add more blacklisted outdated crts --- toolsrc/include/BuildInfo.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 5a85d92d8..22b4bed7d 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -66,6 +66,7 @@ namespace vcpkg struct OutdatedDynamicCrt { + // Old CPP static const OutdatedDynamicCrt MSVCP100_DLL; static const OutdatedDynamicCrt MSVCP100D_DLL; static const OutdatedDynamicCrt MSVCP110_DLL; @@ -75,13 +76,30 @@ namespace vcpkg static const OutdatedDynamicCrt MSVCP60_DLL; static const OutdatedDynamicCrt MSVCP_WIN_DLL; + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + static const std::vector& values() { static const std::vector v = { MSVCP100_DLL, MSVCP100D_DLL, MSVCP110_DLL,MSVCP110_WIN_DLL, MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, MSVCP_WIN_DLL + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL }; return v; } -- cgit v1.2.3 From 2584f3e3def7f09bc373117985013ac019aa76d6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Major refactor/rework of dependency resolution --- toolsrc/include/StatusParagraphs.h | 4 ++++ toolsrc/include/vcpkg.h | 9 +++++++++ toolsrc/include/vcpkg_Dependencies.h | 17 +++++++++++++---- 3 files changed, 26 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 9446d432c..7a0f2177d 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -13,6 +13,10 @@ namespace vcpkg using iterator = container::reverse_iterator; using const_iterator = container::const_reverse_iterator; + const_iterator find(const package_spec& spec) const + { + return find(spec.name(), spec.target_triplet()); + } const_iterator find(const std::string& name, const triplet& target_triplet) const; iterator find(const std::string& name, const triplet& target_triplet); iterator find_installed(const std::string& name, const triplet& target_triplet); diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 1d7f87d32..81b4d45ba 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -16,4 +16,13 @@ namespace vcpkg void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); + + expected try_load_port(const fs::path& control_path); + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) + { + return try_load_port(paths.ports / name); + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); + } // namespace vcpkg diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 8e6808ee3..b556eb7d8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -2,14 +2,23 @@ #include #include "package_spec.h" #include "StatusParagraphs.h" -#include #include "vcpkg_paths.h" namespace vcpkg {namespace Dependencies { - std::vector create_dependency_ordered_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + enum class install_plan_kind + { + BUILD_AND_INSTALL, + INSTALL, + ALREADY_INSTALLED + }; - std::unordered_set get_unmet_dependencies(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + struct install_plan_action + { + install_plan_kind plan; + std::unique_ptr bpgh; + std::unique_ptr spgh; + }; - std::vector get_unmet_package_build_dependencies(const vcpkg_paths& paths, const package_spec& spec); + std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} -- cgit v1.2.3 From 2b204e673914b20e662ed17f667c267690fd6b52 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Use custom struct instead of std::pair --- toolsrc/include/vcpkg_Dependencies.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b556eb7d8..909c27771 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -20,5 +20,11 @@ namespace vcpkg {namespace Dependencies std::unique_ptr spgh; }; - std::vector> create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + struct package_spec_with_install_plan + { + package_spec spec; + install_plan_action install_plan; + }; + + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); }} -- cgit v1.2.3 From b64b0cbc8a34e5761fbf7fda75fda49906f116ea Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: Renames and cleanup --- toolsrc/include/vcpkg_Dependencies.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 909c27771..3616e6be9 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -6,7 +6,7 @@ namespace vcpkg {namespace Dependencies { - enum class install_plan_kind + enum class install_plan_type { BUILD_AND_INSTALL, INSTALL, @@ -15,7 +15,7 @@ namespace vcpkg {namespace Dependencies struct install_plan_action { - install_plan_kind plan; + install_plan_type type; std::unique_ptr bpgh; std::unique_ptr spgh; }; @@ -23,7 +23,7 @@ namespace vcpkg {namespace Dependencies struct package_spec_with_install_plan { package_spec spec; - install_plan_action install_plan; + install_plan_action plan; }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); -- cgit v1.2.3 From 727e4ed6faabead764c4dbffaa5b57f5cfb4017a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 11:56:46 -0800 Subject: [Graph] Now uses set instead of vector --- toolsrc/include/vcpkg_Graphs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 81b189f0e..9444ac45b 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -1,6 +1,7 @@ #pragma once #include +#include namespace vcpkg { namespace Graphs { @@ -21,7 +22,7 @@ namespace vcpkg { namespace Graphs { static void find_topological_sort_internal(V vertex, ExplorationStatus& status, - const std::unordered_map>& adjacency_list, + const std::unordered_map>& adjacency_list, std::unordered_map& exploration_status, std::vector& sorted) { @@ -63,7 +64,7 @@ namespace vcpkg { namespace Graphs void add_edge(V u, V v) { this->vertices[v]; - this->vertices[u].push_back(v); + this->vertices[u].insert(v); } std::vector find_topological_sort() const @@ -108,12 +109,12 @@ namespace vcpkg { namespace Graphs return indegrees; } - const std::unordered_map>& adjacency_list() const + const std::unordered_map>& adjacency_list() const { return this->vertices; } private: - std::unordered_map> vertices; + std::unordered_map> vertices; }; }} -- cgit v1.2.3 From 8a724376746f9550b175a87f0b57c6e6e2d37c5f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:43:09 -0800 Subject: Remove unused #include --- toolsrc/include/vcpkg_Strings.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index d55a01224..859da5658 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -1,6 +1,5 @@ #pragma once -#include #include namespace vcpkg {namespace Strings {namespace details -- cgit v1.2.3 From b88c51bb7eada62c86ecc0aeed49e4fb7e9f754d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 15 Nov 2016 17:53:23 -0800 Subject: [expected.h] Add missing #include --- toolsrc/include/expected.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/expected.h b/toolsrc/include/expected.h index affabcc02..cbb513b22 100644 --- a/toolsrc/include/expected.h +++ b/toolsrc/include/expected.h @@ -1,5 +1,6 @@ #pragma once +#include #include "vcpkg_Checks.h" namespace vcpkg -- cgit v1.2.3 From 692d95c865f271d0805a60fff63fb319c1985ad3 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sat, 26 Nov 2016 02:51:12 -0800 Subject: [vcpkg] Do not return references to locals --- toolsrc/include/BuildInfo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 22b4bed7d..7f64c51cc 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -46,8 +46,8 @@ namespace vcpkg const ConfigurationType& config() const; const LinkageType& linkage() const; - const std::regex& crt_regex() const; - const std::string& toString() const; + const std::regex crt_regex() const; + const std::string toString() const; private: BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) @@ -106,7 +106,7 @@ namespace vcpkg OutdatedDynamicCrt() = delete; - const std::regex& crt_regex() const; + const std::regex crt_regex() const; const std::string& toString() const; private: -- cgit v1.2.3 From 519c54250792cbd2a321f6b4292aeb4d4e3c1a2b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 11:33:32 -0800 Subject: Don't return by const value --- toolsrc/include/BuildInfo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 7f64c51cc..ccf40abbf 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -46,8 +46,8 @@ namespace vcpkg const ConfigurationType& config() const; const LinkageType& linkage() const; - const std::regex crt_regex() const; - const std::string toString() const; + std::regex crt_regex() const; + std::string toString() const; private: BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) -- cgit v1.2.3 From af120041b68f2b9221bdd3cf0047f7e20705aa5a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 17:04:41 -0800 Subject: Move file functions to vcpkg_Files.h --- toolsrc/include/vcpkg_Files.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 445713965..4aa9b956a 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -2,9 +2,12 @@ #include "expected.h" #include +#include namespace vcpkg {namespace Files { + namespace fs = std::tr2::sys; + static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; void check_is_directory(const std::tr2::sys::path& dirpath); @@ -14,4 +17,28 @@ namespace vcpkg {namespace Files expected get_contents(const std::tr2::sys::path& file_path) noexcept; std::tr2::sys::path find_file_recursively_up(const std::tr2::sys::path& starting_dir, const std::string& filename); + + template + void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) + { + std::copy_if(fs::directory_iterator(dir), fs::directory_iterator(), std::back_inserter(*output), predicate); + } + + template + void recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) + { + std::copy_if(fs::recursive_directory_iterator(dir), fs::recursive_directory_iterator(), std::back_inserter(*output), predicate); + } + + template + std::vector recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate) + { + std::vector v; + recursive_find_matching_paths_in_dir(dir, predicate, &v); + return v; + } + + void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output); + + std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension); }} -- cgit v1.2.3 From 74f69ade187dbe091cb00ace4d40ef9d20a3e416 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 17:17:45 -0800 Subject: Introduce PostBuildLint namespace --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/include/post_build_lint.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index ccf40abbf..7c654d9c7 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -6,7 +6,7 @@ namespace fs = std::tr2::sys; -namespace vcpkg +namespace vcpkg { namespace PostBuildLint { enum class LinkageType { @@ -128,4 +128,4 @@ namespace vcpkg }; BuildInfo read_build_info(const fs::path& filepath); -} +}} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h index bc916a7af..a5fb9149f 100644 --- a/toolsrc/include/post_build_lint.h +++ b/toolsrc/include/post_build_lint.h @@ -2,7 +2,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg +namespace vcpkg {namespace PostBuildLint { void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -} +}} -- cgit v1.2.3 From 0b996a002ec6d90d8a132e7603553b60b332c9fe Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:00 -0800 Subject: [Files] Add functions to get all files of a dir recursively or non-recursively --- toolsrc/include/vcpkg_Files.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 4aa9b956a..8ed1eabe1 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -41,4 +41,12 @@ namespace vcpkg {namespace Files void recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension, std::vector* output); std::vector recursive_find_files_with_extension_in_dir(const fs::path& dir, const std::string& extension); + + void recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); + + std::vector recursive_find_all_files_in_dir(const fs::path& dir); + + void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); + + std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); }} -- cgit v1.2.3 From 0042316c4b57cf91ded8e474a8dda354340e7381 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 29 Nov 2016 18:08:53 -0800 Subject: Introduce filesystem_fs.h --- toolsrc/include/BuildInfo.h | 2 -- toolsrc/include/Paragraphs.h | 3 +-- toolsrc/include/coff_file_reader.h | 4 +--- toolsrc/include/filesystem_fs.h | 5 +++++ toolsrc/include/vcpkg.h | 3 --- toolsrc/include/vcpkg_Files.h | 10 ++++------ toolsrc/include/vcpkg_System.h | 5 ++--- toolsrc/include/vcpkg_paths.h | 4 +--- 8 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 toolsrc/include/filesystem_fs.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 7c654d9c7..9f872385e 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,8 +4,6 @@ #include "Paragraphs.h" #include -namespace fs = std::tr2::sys; - namespace vcpkg { namespace PostBuildLint { enum class LinkageType diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 22aaefe98..9e9fafe49 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -1,11 +1,10 @@ #pragma once -#include +#include "filesystem_fs.h" #include namespace vcpkg { namespace Paragraphs { - namespace fs = std::tr2::sys; std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); }} diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 81f107f10..1a9a071ef 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -1,12 +1,10 @@ #pragma once #include #include "MachineType.h" -#include +#include "filesystem_fs.h" namespace vcpkg {namespace COFFFileReader { - namespace fs = std::tr2::sys; - struct dll_info { MachineType machine_type; diff --git a/toolsrc/include/filesystem_fs.h b/toolsrc/include/filesystem_fs.h new file mode 100644 index 000000000..ece485c23 --- /dev/null +++ b/toolsrc/include/filesystem_fs.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +namespace fs = std::tr2::sys; \ No newline at end of file diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 81b4d45ba..832fb1920 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -1,6 +1,5 @@ #pragma once -#include #include "package_spec.h" #include "BinaryParagraph.h" #include "StatusParagraphs.h" @@ -8,8 +7,6 @@ namespace vcpkg { - namespace fs = std::tr2::sys; - extern bool g_do_dry_run; StatusParagraphs database_load_check(const vcpkg_paths& paths); diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 8ed1eabe1..aa25d8333 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -1,22 +1,20 @@ #pragma once #include "expected.h" -#include +#include "filesystem_fs.h" #include namespace vcpkg {namespace Files { - namespace fs = std::tr2::sys; - static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; - void check_is_directory(const std::tr2::sys::path& dirpath); + void check_is_directory(const fs::path& dirpath); bool has_invalid_chars_for_filesystem(const std::string s); - expected get_contents(const std::tr2::sys::path& file_path) noexcept; + expected get_contents(const fs::path& file_path) noexcept; - std::tr2::sys::path find_file_recursively_up(const std::tr2::sys::path& starting_dir, const std::string& filename); + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename); template void non_recursive_find_matching_paths_in_dir(const fs::path& dir, const Pred predicate, std::vector* output) diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index c420464c1..e059bde0a 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -1,12 +1,11 @@ #pragma once #include "vcpkg_Strings.h" - -#include +#include "filesystem_fs.h" namespace vcpkg {namespace System { - std::tr2::sys::path get_exe_path_of_current_process(); + fs::path get_exe_path_of_current_process(); struct exit_code_and_output { diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index 2dc9c7636..a2932070d 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -1,13 +1,11 @@ #pragma once -#include +#include "filesystem_fs.h" #include "expected.h" #include "package_spec.h" #include "BinaryParagraph.h" namespace vcpkg { - namespace fs = std::tr2::sys; - struct vcpkg_paths { static expected create(const fs::path& vcpkg_root_dir); -- cgit v1.2.3 From ae379fedea589552ad7c98eb350c492ce830fb48 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 30 Nov 2016 14:08:43 -0800 Subject: Move print_paths() to Files:: --- toolsrc/include/vcpkg_Files.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index aa25d8333..8b320303d 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -47,4 +47,6 @@ namespace vcpkg {namespace Files void non_recursive_find_all_files_in_dir(const fs::path& dir, std::vector* output); std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); + + void print_paths(const std::vector& paths); }} -- cgit v1.2.3 From 89aaf195fbdfa63708fd6ac90103cac0cdedf3c6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 01:37:41 -0800 Subject: Remove unused variable --- toolsrc/include/vcpkg.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 832fb1920..2fc993616 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -7,19 +7,17 @@ namespace vcpkg { - extern bool g_do_dry_run; - StatusParagraphs database_load_check(const vcpkg_paths& paths); void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); expected try_load_port(const fs::path& control_path); + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) { return try_load_port(paths.ports / name); } expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); - } // namespace vcpkg -- cgit v1.2.3 From 6eac44c9640a50fbde88535df6261a1a3f234350 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 01:49:24 -0800 Subject: Move install_package() and deinstall_package() to the files of the appropriate commands --- toolsrc/include/vcpkg.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 2fc993616..ef78e213e 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -9,8 +9,7 @@ namespace vcpkg { StatusParagraphs database_load_check(const vcpkg_paths& paths); - void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs& status_db); - void deinstall_package(const vcpkg_paths& paths, const package_spec& spec, StatusParagraphs& status_db); + void write_update(const vcpkg_paths& paths, const StatusParagraph& p); expected try_load_port(const fs::path& control_path); -- cgit v1.2.3 From 7c2abc755f58beaea36aa1cbc1c3b7f375e567a3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 1 Dec 2016 15:36:39 -0800 Subject: Introduce function get_installed_files() --- toolsrc/include/vcpkg.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index ef78e213e..75dc40b43 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -11,6 +11,14 @@ namespace vcpkg void write_update(const vcpkg_paths& paths, const StatusParagraph& p); + struct StatusParagraph_and_associated_files + { + StatusParagraph pgh; + std::vector files; + }; + + std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + expected try_load_port(const fs::path& control_path); inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) -- cgit v1.2.3 From 1310e9e052de50a8d53bc9b88696f8b6c61bece6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 12 Dec 2016 14:03:13 -0800 Subject: Add SQM User Id to metrics --- toolsrc/include/metrics.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/metrics.h b/toolsrc/include/metrics.h index 52662cd97..a0f4fc61d 100644 --- a/toolsrc/include/metrics.h +++ b/toolsrc/include/metrics.h @@ -13,6 +13,7 @@ namespace vcpkg void TrackProperty(const std::string& name, const std::string& value); void TrackProperty(const std::string& name, const std::wstring& value); bool GetCompiledMetricsEnabled(); + std::wstring GetSQMUser(); void Upload(const std::string& payload); void Flush(); -- cgit v1.2.3 From d02fe9bdae3553660896d14ef24c2b6dc82bb6db Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 14:58:38 -0800 Subject: Add System::println(std::string) overloads --- toolsrc/include/vcpkg_System.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index e059bde0a..ca81235ed 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -39,6 +39,26 @@ namespace vcpkg {namespace System void print(color c, const char* message); void println(color c, const char* message); + inline void print(const std::string& message) + { + return print(message.c_str()); + } + + inline void println(const std::string& message) + { + return println(message.c_str()); + } + + inline void print(color c, const std::string& message) + { + return print(c, message.c_str()); + } + + inline void println(color c, const std::string& message) + { + return println(c, message.c_str()); + } + template void print(const char* messageTemplate, const Args&... messageArgs) { -- cgit v1.2.3 From b629cd904440c640b7e5b4c3fdf17df5aac90bad Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:03:36 -0800 Subject: [vcpkg_cmd_arguments] Use std::string instead of char* --- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 95feb4814..2194e6d2c 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -24,11 +24,11 @@ namespace vcpkg std::unordered_set check_and_get_optional_command_arguments(const std::vector& valid_options) const; void check_max_arg_count(const size_t expected_arg_count) const; - void check_max_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_max_arg_count(const size_t expected_arg_count, const std::string& example_text) const; void check_min_arg_count(const size_t expected_arg_count) const; - void check_min_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_min_arg_count(const size_t expected_arg_count, const std::string& example_text) const; void check_exact_arg_count(const size_t expected_arg_count) const; - void check_exact_arg_count(const size_t expected_arg_count, const char* example_text) const; + void check_exact_arg_count(const size_t expected_arg_count, const std::string& example_text) const; private: std::unordered_set optional_command_arguments; -- cgit v1.2.3 From 852acbc2638c21d9639258417b8cd9fceed722c2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:05:49 -0800 Subject: [vcpkg_Input] Use std::string instead of char* --- toolsrc/include/vcpkg_Input.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index bbf3adfbf..5ce90e3b9 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -5,9 +5,9 @@ namespace vcpkg {namespace Input { - package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const char* example_text); + package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text); - std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const char* example_text); + std::vector check_and_get_package_specs(const std::vector& package_specs_as_strings, const triplet& default_target_triplet, const std::string& example_text); void check_triplet(const triplet& t, const vcpkg_paths& paths); -- cgit v1.2.3 From c77be8f221dbbb7b38c74ce382be9b4dbb4d296b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:08:26 -0800 Subject: [vcpkg_System] Add missing const keywords --- toolsrc/include/vcpkg_System.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index ca81235ed..1101c9b27 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -36,8 +36,8 @@ namespace vcpkg {namespace System void print(const char* message); void println(const char* message); - void print(color c, const char* message); - void println(color c, const char* message); + void print(const color c, const char* message); + void println(const color c, const char* message); inline void print(const std::string& message) { @@ -49,12 +49,12 @@ namespace vcpkg {namespace System return println(message.c_str()); } - inline void print(color c, const std::string& message) + inline void print(const color c, const std::string& message) { return print(c, message.c_str()); } - inline void println(color c, const std::string& message) + inline void println(const color c, const std::string& message) { return println(c, message.c_str()); } @@ -66,7 +66,7 @@ namespace vcpkg {namespace System } template - void print(color c, const char* messageTemplate, const Args&... messageArgs) + void print(const color c, const char* messageTemplate, const Args&... messageArgs) { return print(c, Strings::format(messageTemplate, messageArgs...).c_str()); } @@ -78,7 +78,7 @@ namespace vcpkg {namespace System } template - void println(color c, const char* messageTemplate, const Args&... messageArgs) + void println(const color c, const char* messageTemplate, const Args&... messageArgs) { return println(c, Strings::format(messageTemplate, messageArgs...).c_str()); } -- cgit v1.2.3 From e523668cce29745d8024dd5d56ee1d705da24a49 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 12 Dec 2016 15:13:24 -0800 Subject: Change signature to std::string& (from char*) --- toolsrc/include/vcpkg_Commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 8272929a7..fd427fd40 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -8,8 +8,8 @@ namespace vcpkg extern const char*const INTEGRATE_COMMAND_HELPSTRING; void print_usage(); - void print_example(const char* command_and_arguments); - std::string create_example_string(const char* command_and_arguments); + void print_example(const std::string& command_and_arguments); + std::string create_example_string(const std::string& command_and_arguments); void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); -- cgit v1.2.3 From 8f397bb8d1bd05a2e1f6d5de808322364100ae5d Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 17:09:14 -0800 Subject: Add Strings::trim() function --- toolsrc/include/vcpkg_Strings.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 859da5658..92c24298c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -69,4 +69,8 @@ namespace vcpkg {namespace Strings std::string ascii_to_lowercase(const std::string& input); std::string join(const std::vector& v, const std::string& delimiter); + + void trim(std::string* s); + + std::string trimmed(const std::string& s); }} -- cgit v1.2.3 From e4548a8cf46b20b8e89ab75ee9201e3b244484ba Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 15 Dec 2016 18:19:22 -0800 Subject: Add Files::read_all_lines() and Files::write_all_lines() --- toolsrc/include/vcpkg_Files.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 8b320303d..5e788f7be 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -14,6 +14,10 @@ namespace vcpkg {namespace Files expected get_contents(const fs::path& file_path) noexcept; + expected> read_all_lines(const fs::path& file_path); + + void write_all_lines(const fs::path& file_path, const std::vector& lines); + fs::path find_file_recursively_up(const fs::path& starting_dir, const std::string& filename); template -- cgit v1.2.3 From a5c3fddfe7bc4f765a0efdd9b109709f2fb4ae9c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 16:02:19 -0800 Subject: Add Strings::trim_all_and_remove_whitespace_strings() --- toolsrc/include/vcpkg_Strings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 92c24298c..a117a1a81 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -73,4 +73,6 @@ namespace vcpkg {namespace Strings void trim(std::string* s); std::string trimmed(const std::string& s); + + void trim_all_and_remove_whitespace_strings(std::vector* strings); }} -- cgit v1.2.3 From b666e90c32e58a673331b303e64e299cc1168aa2 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 19:38:02 -0800 Subject: Pass by ref --- toolsrc/include/vcpkg_Files.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 5e788f7be..b0a9747bf 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -10,7 +10,7 @@ namespace vcpkg {namespace Files void check_is_directory(const fs::path& dirpath); - bool has_invalid_chars_for_filesystem(const std::string s); + bool has_invalid_chars_for_filesystem(const std::string& s); expected get_contents(const fs::path& file_path) noexcept; -- cgit v1.2.3 From aad0cc4c042aad87b2b52eded0e465ed01e799c1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 19:40:58 -0800 Subject: Files::get_contents() -> Files::read_contents() --- toolsrc/include/vcpkg_Files.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index b0a9747bf..6c9d0d365 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -12,7 +12,7 @@ namespace vcpkg {namespace Files bool has_invalid_chars_for_filesystem(const std::string& s); - expected get_contents(const fs::path& file_path) noexcept; + expected read_contents(const fs::path& file_path) noexcept; expected> read_all_lines(const fs::path& file_path); -- cgit v1.2.3 From 73bf8306b29d68853dc3c97d5dd415bd5e857cf5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 20:11:50 -0800 Subject: Pass by const ref --- toolsrc/include/coff_file_reader.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index 1a9a071ef..edf6910a5 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -15,7 +15,7 @@ namespace vcpkg {namespace COFFFileReader std::vector machine_types; }; - dll_info read_dll(const fs::path path); + dll_info read_dll(const fs::path& path); - lib_info read_lib(const fs::path path); + lib_info read_lib(const fs::path& path); }} -- cgit v1.2.3 From 835693ce97f271c0213f65c1c782e8df84cfb409 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 16 Dec 2016 20:17:24 -0800 Subject: Don't return by const value --- toolsrc/include/BuildInfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 9f872385e..49811d521 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -104,7 +104,7 @@ namespace vcpkg { namespace PostBuildLint OutdatedDynamicCrt() = delete; - const std::regex crt_regex() const; + std::regex crt_regex() const; const std::string& toString() const; private: -- cgit v1.2.3 From 0b5e2e9e76e66b566cf4d3f68146fdbdff2bac05 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 12:47:08 -0800 Subject: Use nested namespace definition --- toolsrc/include/vcpkg_Checks.h | 4 ++-- toolsrc/include/vcpkg_Files.h | 4 ++-- toolsrc/include/vcpkg_Graphs.h | 4 ++-- toolsrc/include/vcpkg_Maps.h | 4 ++-- toolsrc/include/vcpkg_Sets.h | 4 ++-- toolsrc/include/vcpkg_Strings.h | 8 ++++---- toolsrc/include/vcpkg_System.h | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg_Checks.h index 9d9b21ed6..a58b38ac0 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg_Checks.h @@ -2,7 +2,7 @@ #include "vcpkg_Strings.h" -namespace vcpkg {namespace Checks +namespace vcpkg::Checks { __declspec(noreturn) void unreachable(); @@ -46,4 +46,4 @@ namespace vcpkg {namespace Checks exit_with_message(Strings::format(errorMessageTemplate, errorMessageArgs...).c_str()); } } -}} +} diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg_Files.h index 6c9d0d365..3f9570946 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg_Files.h @@ -4,7 +4,7 @@ #include "filesystem_fs.h" #include -namespace vcpkg {namespace Files +namespace vcpkg::Files { static const char* FILESYSTEM_INVALID_CHARACTERS = R"(\/:*?"<>|)"; @@ -53,4 +53,4 @@ namespace vcpkg {namespace Files std::vector non_recursive_find_all_files_in_dir(const fs::path& dir); void print_paths(const std::vector& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg_Graphs.h index 9444ac45b..933d9ac67 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg_Graphs.h @@ -3,7 +3,7 @@ #include #include -namespace vcpkg { namespace Graphs +namespace vcpkg::Graphs { enum class ExplorationStatus { @@ -117,4 +117,4 @@ namespace vcpkg { namespace Graphs private: std::unordered_map> vertices; }; -}} +} diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h index c67462a39..5e2f92f55 100644 --- a/toolsrc/include/vcpkg_Maps.h +++ b/toolsrc/include/vcpkg_Maps.h @@ -4,7 +4,7 @@ #include #include -namespace vcpkg { namespace Maps +namespace vcpkg::Maps { template std::unordered_set extract_key_set(const std::unordered_map& input_map) @@ -38,4 +38,4 @@ namespace vcpkg { namespace Maps } return key_set; } -}} +} diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 7b330f31c..6dec95b89 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -3,7 +3,7 @@ #include "vcpkg_Checks.h" #include -namespace vcpkg { namespace Sets +namespace vcpkg::Sets { template void remove_all(std::unordered_set* input_set, Container remove_these) @@ -14,4 +14,4 @@ namespace vcpkg { namespace Sets input_set->erase(r); } } -}} +} diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index a117a1a81..28853cb5d 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace Strings {namespace details +namespace vcpkg::Strings::details { inline const char* to_printf_arg(const std::string& s) { @@ -42,9 +42,9 @@ namespace vcpkg {namespace Strings {namespace details } std::wstring wformat_internal(const wchar_t* fmtstr, ...); -}}} +} -namespace vcpkg {namespace Strings +namespace vcpkg::Strings { template std::string format(const char* fmtstr, const Args&...args) @@ -75,4 +75,4 @@ namespace vcpkg {namespace Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); -}} +} diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg_System.h index 1101c9b27..c9195163c 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg_System.h @@ -3,7 +3,7 @@ #include "vcpkg_Strings.h" #include "filesystem_fs.h" -namespace vcpkg {namespace System +namespace vcpkg::System { fs::path get_exe_path_of_current_process(); @@ -93,4 +93,4 @@ namespace vcpkg {namespace System }; std::wstring wdupenv_str(const wchar_t* varname) noexcept; -}} +} -- cgit v1.2.3 From 88b5791b0bcaa9cce7f488bbd03042aa65e4417e Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:14:11 -0800 Subject: Use Nested Namespace Definition --- toolsrc/include/coff_file_reader.h | 4 ++-- toolsrc/include/post_build_lint.h | 4 ++-- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- toolsrc/include/vcpkg_Environment.h | 4 ++-- toolsrc/include/vcpkg_Input.h | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/coff_file_reader.h index edf6910a5..24fbf4576 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/coff_file_reader.h @@ -3,7 +3,7 @@ #include "MachineType.h" #include "filesystem_fs.h" -namespace vcpkg {namespace COFFFileReader +namespace vcpkg::COFFFileReader { struct dll_info { @@ -18,4 +18,4 @@ namespace vcpkg {namespace COFFFileReader dll_info read_dll(const fs::path& path); lib_info read_lib(const fs::path& path); -}} +} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h index a5fb9149f..215a237aa 100644 --- a/toolsrc/include/post_build_lint.h +++ b/toolsrc/include/post_build_lint.h @@ -2,7 +2,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace PostBuildLint +namespace vcpkg::PostBuildLint { void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -}} +} diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 3616e6be9..4da9de694 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -4,7 +4,7 @@ #include "StatusParagraphs.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Dependencies +namespace vcpkg::Dependencies { enum class install_plan_type { @@ -27,4 +27,4 @@ namespace vcpkg {namespace Dependencies }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); -}} +} diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 877ac7deb..1e8624d89 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -1,7 +1,7 @@ #pragma once #include "vcpkg_paths.h" -namespace vcpkg {namespace Environment +namespace vcpkg::Environment { void ensure_nuget_on_path(const vcpkg_paths& paths); @@ -14,4 +14,4 @@ namespace vcpkg {namespace Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } -}} +} diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 5ce90e3b9..3cce334c4 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -3,7 +3,7 @@ #include "package_spec.h" #include "vcpkg_paths.h" -namespace vcpkg {namespace Input +namespace vcpkg::Input { package_spec check_and_get_package_spec(const std::string& package_spec_as_string, const triplet& default_target_triplet, const std::string& example_text); @@ -12,4 +12,4 @@ namespace vcpkg {namespace Input void check_triplet(const triplet& t, const vcpkg_paths& paths); void check_triplets(std::vector triplets, const vcpkg_paths& paths); -}} +} -- cgit v1.2.3 From 6e29b7b8d4b3a21e46a721f79d184213d1c874a4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:21:09 -0800 Subject: Pass by reference --- toolsrc/include/vcpkg_Input.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h index 3cce334c4..96cbeecc3 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg_Input.h @@ -11,5 +11,5 @@ namespace vcpkg::Input void check_triplet(const triplet& t, const vcpkg_paths& paths); - void check_triplets(std::vector triplets, const vcpkg_paths& paths); + void check_triplets(const std::vector& triplets, const vcpkg_paths& paths); } -- cgit v1.2.3 From 708e93d82acd4da9c651cc7043dfd32a182ecc11 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 5 Jan 2017 14:25:50 -0800 Subject: Use Nested Namespace Definition --- toolsrc/include/BuildInfo.h | 4 ++-- toolsrc/include/Paragraphs.h | 4 ++-- toolsrc/include/vcpkg_info.h | 4 ++-- toolsrc/include/vcpkglib_helpers.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index 49811d521..c90ad7a4e 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -4,7 +4,7 @@ #include "Paragraphs.h" #include -namespace vcpkg { namespace PostBuildLint +namespace vcpkg::PostBuildLint { enum class LinkageType { @@ -126,4 +126,4 @@ namespace vcpkg { namespace PostBuildLint }; BuildInfo read_build_info(const fs::path& filepath); -}} +} diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h index 9e9fafe49..761b49759 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/Paragraphs.h @@ -3,8 +3,8 @@ #include "filesystem_fs.h" #include -namespace vcpkg { namespace Paragraphs +namespace vcpkg::Paragraphs { std::vector> get_paragraphs(const fs::path& control_path); std::vector> parse_paragraphs(const std::string& str); -}} +} diff --git a/toolsrc/include/vcpkg_info.h b/toolsrc/include/vcpkg_info.h index 01da06307..5380e0158 100644 --- a/toolsrc/include/vcpkg_info.h +++ b/toolsrc/include/vcpkg_info.h @@ -2,9 +2,9 @@ #include -namespace vcpkg { namespace Info +namespace vcpkg::Info { const std::string& version(); const std::string& email(); -}} +} diff --git a/toolsrc/include/vcpkglib_helpers.h b/toolsrc/include/vcpkglib_helpers.h index 019bb8c39..8a08513f3 100644 --- a/toolsrc/include/vcpkglib_helpers.h +++ b/toolsrc/include/vcpkglib_helpers.h @@ -2,7 +2,7 @@ #include -namespace vcpkg {namespace details +namespace vcpkg::details { std::string optional_field(const std::unordered_map& fields, const std::string& fieldname); std::string remove_optional_field(std::unordered_map* fields, const std::string& fieldname); @@ -11,4 +11,4 @@ namespace vcpkg {namespace details std::string remove_required_field(std::unordered_map* fields, const std::string& fieldname); std::string shorten_description(const std::string& desc); -}} +} -- cgit v1.2.3 From e5f60816cb6a786aa828aa2845522bb81c02cbe6 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 22 Dec 2016 16:43:47 -0800 Subject: Introduce ImmutableSortedVector --- toolsrc/include/ImmutableSortedVector.h | 48 +++++++++++++++++++++++++++++++++ toolsrc/include/vcpkg.h | 3 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 toolsrc/include/ImmutableSortedVector.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/ImmutableSortedVector.h b/toolsrc/include/ImmutableSortedVector.h new file mode 100644 index 000000000..681f9fd4d --- /dev/null +++ b/toolsrc/include/ImmutableSortedVector.h @@ -0,0 +1,48 @@ +#pragma once + +#include +#include + +// Add more forwarding functions to the delegate std::vector as needed. +namespace vcpkg +{ + template + class ImmutableSortedVector + { + public: + static ImmutableSortedVector create(std::vector vector) + { + ImmutableSortedVector out; + out.delegate = std::move(vector); + if (!std::is_sorted(out.delegate.cbegin(), out.delegate.cend())) + { + std::sort(out.delegate.begin(), out.delegate.end()); + } + + return out; + } + + typename std::vector::const_iterator begin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator end() const + { + return this->delegate.cend(); + } + + typename std::vector::const_iterator cbegin() const + { + return this->delegate.cbegin(); + } + + typename std::vector::const_iterator cend() const + { + return this->delegate.cend(); + } + + private: + std::vector delegate; + }; +} diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h index 75dc40b43..b1653d197 100644 --- a/toolsrc/include/vcpkg.h +++ b/toolsrc/include/vcpkg.h @@ -4,6 +4,7 @@ #include "BinaryParagraph.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "ImmutableSortedVector.h" namespace vcpkg { @@ -14,7 +15,7 @@ namespace vcpkg struct StatusParagraph_and_associated_files { StatusParagraph pgh; - std::vector files; + ImmutableSortedVector files; }; std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); -- cgit v1.2.3 From 6a4ec92a90849e7cc343bbc8673ce0f063ffd939 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:03:21 -0800 Subject: Place build & build_external commands into separate files --- toolsrc/include/vcpkg_Commands.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index fd427fd40..213d31ada 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,6 +5,12 @@ namespace vcpkg { + // + namespace Commands::details + { + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + } + extern const char*const INTEGRATE_COMMAND_HELPSTRING; void print_usage(); -- cgit v1.2.3 From df2a05e8546281135c6ea12430734d74371bcf46 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 17:35:33 -0800 Subject: Introduce Command namespace. Refactoring --- toolsrc/include/vcpkg_Commands.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 213d31ada..6b4941cc1 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -3,21 +3,17 @@ #include "vcpkg_cmd_arguments.h" #include "vcpkg_paths.h" -namespace vcpkg +namespace vcpkg::Commands { - // - namespace Commands::details - { - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - } - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - void print_usage(); - void print_example(const std::string& command_and_arguments); - std::string create_example_string(const std::string& command_and_arguments); + using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + using command_type_c = void(*)(const vcpkg_cmd_arguments& args); + void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); @@ -30,7 +26,6 @@ namespace vcpkg void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void internal_test_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); @@ -45,10 +40,6 @@ namespace vcpkg void contact_command(const vcpkg_cmd_arguments& args); void hash_command(const vcpkg_cmd_arguments& args); - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - template struct package_name_and_function { @@ -61,7 +52,7 @@ namespace vcpkg const std::vector>& get_available_commands_type_c(); template - T find_command(const std::string& command_name, const std::vector> available_commands) + T find(const std::string& command_name, const std::vector> available_commands) { for (const package_name_and_function& cmd : available_commands) { @@ -75,3 +66,12 @@ namespace vcpkg return nullptr; } } + +namespace vcpkg::Commands::Helpers +{ + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); +} -- cgit v1.2.3 From cc8851144a871931b93d84bd962364159ad1c424 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 12 Jan 2017 22:03:57 -0800 Subject: Reorganize commands, each in its own namespace Additionally, functions related to a command can now live in the same namespace --- toolsrc/include/vcpkg_Commands.h | 123 +++++++++++++++++++++++++++++---------- 1 file changed, 92 insertions(+), 31 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 6b4941cc1..8d772b255 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -5,40 +5,110 @@ namespace vcpkg::Commands { - extern const char*const INTEGRATE_COMMAND_HELPSTRING; - using command_type_a = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); using command_type_b = void(*)(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); using command_type_c = void(*)(const vcpkg_cmd_arguments& args); - void update_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Build + { + void build_package(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace BuildExternal + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Install + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Remove + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + } + + namespace Update + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Create + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Edit + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Search + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace List + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Import + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Owns + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Cache + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace Integrate + { + extern const char*const INTEGRATE_COMMAND_HELPSTRING; + + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } + + namespace PortsDiff + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + } - void build_internal(const SourceParagraph& source_paragraph, const package_spec& spec, const vcpkg_paths& paths, const fs::path& port_dir); - void build_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void build_external_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void install_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); - void remove_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths, const triplet& default_target_triplet); + namespace Help + { + void perform_and_exit(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void edit_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void create_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void help_topic_valid_triplet(const vcpkg_paths& paths); - void search_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void list_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void import_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void print_usage(); - void cache_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + void print_example(const std::string& command_and_arguments); - void integrate_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + std::string create_example_string(const std::string& command_and_arguments); + } - void portsdiff_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); + namespace Version + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } - void help_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths); - void help_topic_valid_triplet(const vcpkg_paths& paths); + namespace Contact + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } - void version_command(const vcpkg_cmd_arguments& args); - void contact_command(const vcpkg_cmd_arguments& args); - void hash_command(const vcpkg_cmd_arguments& args); + namespace Hash + { + void perform_and_exit(const vcpkg_cmd_arguments& args); + } template struct package_name_and_function @@ -66,12 +136,3 @@ namespace vcpkg::Commands return nullptr; } } - -namespace vcpkg::Commands::Helpers -{ - void print_usage(); - - void print_example(const std::string& command_and_arguments); - - std::string create_example_string(const std::string& command_and_arguments); -} -- cgit v1.2.3 From 6d3ab4579d50f74cbe43373fa16ba875a97a8717 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:12:43 -0800 Subject: [vcpkg_paths] Add "scripts" entry --- toolsrc/include/vcpkg_paths.h | 1 + 1 file changed, 1 insertion(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_paths.h b/toolsrc/include/vcpkg_paths.h index a2932070d..ba6defb9f 100644 --- a/toolsrc/include/vcpkg_paths.h +++ b/toolsrc/include/vcpkg_paths.h @@ -24,6 +24,7 @@ namespace vcpkg fs::path ports; fs::path installed; fs::path triplets; + fs::path scripts; fs::path buildsystems; fs::path buildsystems_msbuild_targets; -- cgit v1.2.3 From 3a6571a0191df8ff000384937a6254f378ca23cf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:13:12 -0800 Subject: Add Strings::split() function --- toolsrc/include/vcpkg_Strings.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 28853cb5d..cb5d2334c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -75,4 +75,6 @@ namespace vcpkg::Strings std::string trimmed(const std::string& s); void trim_all_and_remove_whitespace_strings(std::vector* strings); + + std::vector split(const std::string& s, const std::string& delimiter); } -- cgit v1.2.3 From 79a00367390dd974170b3abb5ad357d3db8ff5e3 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 15:15:26 -0800 Subject: [VS2017] Add function do get dumpbin.exe --- toolsrc/include/vcpkg_Environment.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 1e8624d89..64b2315b9 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -14,4 +14,6 @@ namespace vcpkg::Environment ensure_cmake_on_path(paths); ensure_git_on_path(paths); } + + const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); } -- cgit v1.2.3 From e0e3f6ac21d074b0c043e9d6a2aff769930f07a7 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 16:15:30 -0800 Subject: [VS2017] Add function to get vcvarsall.bat --- toolsrc/include/vcpkg_Environment.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 64b2315b9..9161f7ce5 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -16,4 +16,6 @@ namespace vcpkg::Environment } const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); + + const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); } -- cgit v1.2.3 From 93c3c0648a782b1fa75bae1f200beca6ba871f9a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 23 Jan 2017 19:25:47 -0800 Subject: [VS2017] Enable building with v141 toolset --- toolsrc/include/vcpkg_Environment.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Environment.h b/toolsrc/include/vcpkg_Environment.h index 9161f7ce5..e4dd47472 100644 --- a/toolsrc/include/vcpkg_Environment.h +++ b/toolsrc/include/vcpkg_Environment.h @@ -17,5 +17,11 @@ namespace vcpkg::Environment const fs::path& get_dumpbin_exe(const vcpkg_paths& paths); - const fs::path& get_vcvarsall_bat(const vcpkg_paths& paths); + struct vcvarsall_and_platform_toolset + { + fs::path path; + std::wstring platform_toolset; + }; + + const vcvarsall_and_platform_toolset& get_vcvarsall_bat(const vcpkg_paths& paths); } -- cgit v1.2.3 From 59be40a100910d1f833cd54762e624b7123965ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:32:50 -0800 Subject: Rename vcpkg.h/cpp to vcpkglib.h/cpp --- toolsrc/include/vcpkg.h | 31 ------------------------------- toolsrc/include/vcpkglib.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 toolsrc/include/vcpkg.h create mode 100644 toolsrc/include/vcpkglib.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg.h b/toolsrc/include/vcpkg.h deleted file mode 100644 index b1653d197..000000000 --- a/toolsrc/include/vcpkg.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once - -#include "package_spec.h" -#include "BinaryParagraph.h" -#include "StatusParagraphs.h" -#include "vcpkg_paths.h" -#include "ImmutableSortedVector.h" - -namespace vcpkg -{ - StatusParagraphs database_load_check(const vcpkg_paths& paths); - - void write_update(const vcpkg_paths& paths, const StatusParagraph& p); - - struct StatusParagraph_and_associated_files - { - StatusParagraph pgh; - ImmutableSortedVector files; - }; - - std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); - - expected try_load_port(const fs::path& control_path); - - inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) - { - return try_load_port(paths.ports / name); - } - - expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); -} // namespace vcpkg diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkglib.h new file mode 100644 index 000000000..b1653d197 --- /dev/null +++ b/toolsrc/include/vcpkglib.h @@ -0,0 +1,31 @@ +#pragma once + +#include "package_spec.h" +#include "BinaryParagraph.h" +#include "StatusParagraphs.h" +#include "vcpkg_paths.h" +#include "ImmutableSortedVector.h" + +namespace vcpkg +{ + StatusParagraphs database_load_check(const vcpkg_paths& paths); + + void write_update(const vcpkg_paths& paths, const StatusParagraph& p); + + struct StatusParagraph_and_associated_files + { + StatusParagraph pgh; + ImmutableSortedVector files; + }; + + std::vector get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db); + + expected try_load_port(const fs::path& control_path); + + inline expected try_load_port(const vcpkg_paths& paths, const std::string& name) + { + return try_load_port(paths.ports / name); + } + + expected try_load_cached_package(const vcpkg_paths& paths, const package_spec& spec); +} // namespace vcpkg -- cgit v1.2.3 From 2a246f26af6771482938d4052e08ce2fdbad92e8 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 25 Jan 2017 19:38:14 -0800 Subject: Change check_throw() to check_exit() --- toolsrc/include/vcpkg_Sets.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Sets.h b/toolsrc/include/vcpkg_Sets.h index 6dec95b89..ec4800864 100644 --- a/toolsrc/include/vcpkg_Sets.h +++ b/toolsrc/include/vcpkg_Sets.h @@ -8,7 +8,7 @@ namespace vcpkg::Sets template void remove_all(std::unordered_set* input_set, Container remove_these) { - Checks::check_throw(input_set != nullptr, "Input set cannot be null"); + Checks::check_exit(input_set != nullptr, "Input set cannot be null"); for (const T& r : remove_these) { input_set->erase(r); -- cgit v1.2.3 From 9502d795bb325669df8e4e3b32f6ca60827813f1 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 14:25:36 -0800 Subject: Move & rename remove_plan_type enum --- toolsrc/include/vcpkg_Dependencies.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 4da9de694..1c49ccafd 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -26,5 +26,13 @@ namespace vcpkg::Dependencies install_plan_action plan; }; + enum class remove_plan_type + { + NOT_INSTALLED, + DEPENDENCIES_NOT_SATISFIED, + SHOULD_REMOVE + }; + + std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } -- cgit v1.2.3 From cc81c3de6c74837dc146d7d3de73e4388cfc14dc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:52:54 -0800 Subject: [StatusParagraphs] Replace auto with actual type --- toolsrc/include/StatusParagraphs.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h index 7a0f2177d..11491cf4e 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/StatusParagraphs.h @@ -1,6 +1,7 @@ #pragma once #include "StatusParagraph.h" #include +#include namespace vcpkg { @@ -25,22 +26,22 @@ namespace vcpkg friend std::ostream& operator<<(std::ostream&, const StatusParagraphs&); - auto end() + iterator end() { return paragraphs.rend(); } - auto end() const + const_iterator end() const { return paragraphs.rend(); } - auto begin() + iterator begin() { return paragraphs.rbegin(); } - auto begin() const + const_iterator begin() const { return paragraphs.rbegin(); } -- cgit v1.2.3 From 33b46b1fee70996a23a7860f853e95ef80ff3978 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Thu, 26 Jan 2017 17:53:45 -0800 Subject: Create a remove plan. NOT used yet --- toolsrc/include/vcpkg_Dependencies.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 1c49ccafd..528abedfb 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -30,9 +30,23 @@ namespace vcpkg::Dependencies { NOT_INSTALLED, DEPENDENCIES_NOT_SATISFIED, - SHOULD_REMOVE + REMOVE, + REMOVE_USER_REQUESTED }; + struct remove_plan_action + { + remove_plan_type type; + std::unique_ptr bpgh; + }; + + struct package_spec_with_remove_plan + { + package_spec spec; + remove_plan_action plan; + }; std::vector create_install_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); + + std::vector create_remove_plan(const vcpkg_paths& paths, const std::vector& specs, const StatusParagraphs& status_db); } -- cgit v1.2.3 From 050e4a0f7a8156bd862f95c06ea298ab6697e147 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 12:49:09 -0800 Subject: Introduce precompiled headers --- toolsrc/include/pch.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 toolsrc/include/pch.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h new file mode 100644 index 000000000..48aca2b77 --- /dev/null +++ b/toolsrc/include/pch.h @@ -0,0 +1,38 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN +#define NOMINMAX +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include \ No newline at end of file -- cgit v1.2.3 From 6f363339d8eb5cd8c7a2dd83787af3a34ff0eb4b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:33:54 -0800 Subject: Reorganize pch.h --- toolsrc/include/pch.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 48aca2b77..2c8b5b5f7 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -7,32 +7,33 @@ #include #include -#include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include #include #include #include #include -#include + +#include #include -#include + +#include +#include +#include #include +#include +#include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include -#include -#include \ No newline at end of file +#include +#include -- cgit v1.2.3 From 9da07d4540c0c0bb34fedad649e4e2d5a75bbf09 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 14:37:14 -0800 Subject: Add and to pch.h --- toolsrc/include/pch.h | 3 +++ toolsrc/include/vcpkg_cmd_arguments.h | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 2c8b5b5f7..56f24f161 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include #include +#include #include #include +#include diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 2194e6d2c..8ace98586 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -4,7 +4,6 @@ #include #include #include "opt_bool.h" -#include "vcpkg_paths.h" namespace vcpkg { -- cgit v1.2.3 From 4059d4a6b9f9467ff5c58594f7304eef7ba79664 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 17:28:00 -0800 Subject: [package_spec] Make toString() a member function --- toolsrc/include/package_spec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 30dfca5c7..01b4377a5 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -18,13 +18,13 @@ namespace vcpkg std::string dir() const; + std::string toString() const; + private: std::string m_name; triplet m_target_triplet; }; - std::string to_string(const package_spec& spec); - std::string to_printf_arg(const package_spec& spec); bool operator==(const package_spec& left, const package_spec& right); -- cgit v1.2.3 From 0f0698dc18ec162666ed92b4ac181e512b439b83 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:09:40 -0800 Subject: Introduce Strings::Joiner --- toolsrc/include/vcpkg_Strings.h | 50 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index cb5d2334c..8d5d7135b 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -68,7 +68,55 @@ namespace vcpkg::Strings std::string ascii_to_lowercase(const std::string& input); - std::string join(const std::vector& v, const std::string& delimiter); + template + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix, Transformer transformer) + { + if (v.empty()) + { + return std::string(); + } + + std::string output; + size_t size = v.size(); + + output.append(prefix); + output.append(transformer(v.at(0))); + + for (size_t i = 1; i < size; ++i) + { + output.append(delimiter); + output.append(transformer(v.at(i))); + } + + output.append(suffix); + return output; + } + + static std::string join(const std::vector& v, const std::string& prefix, const std::string& delimiter, const std::string& suffix); + + class Joiner + { + public: + static Joiner on(const std::string& delimiter); + + Joiner& prefix(const std::string& prefix); + Joiner& suffix(const std::string& suffix); + + std::string join(const std::vector& v) const; + + template + std::string join(const std::vector& v, Transformer transformer) const + { + return Strings::join(v, this->m_prefix, this->m_delimiter, this->m_suffix, transformer); + } + + private: + explicit Joiner(const std::string& delimiter); + + std::string m_prefix; + std::string m_delimiter; + std::string m_suffix; + }; void trim(std::string* s); -- cgit v1.2.3 From e0577978c512cbc3ea0e05067882b14eedacc679 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Fri, 27 Jan 2017 20:21:04 -0800 Subject: Remove unneeded #include directive --- toolsrc/include/package_spec.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index 01b4377a5..b469567c7 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -1,5 +1,4 @@ #pragma once -#include #include "package_spec_parse_result.h" #include "triplet.h" #include "expected.h" -- cgit v1.2.3 From 661776fe29344c431731e5ae464da4942b38bf79 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:34:36 -0800 Subject: Enable recursive `remove` command --- toolsrc/include/vcpkg_Dependencies.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 528abedfb..2a3030c89 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -29,15 +29,14 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - DEPENDENCIES_NOT_SATISFIED, - REMOVE, + REMOVE_AUTO_SELECTED, REMOVE_USER_REQUESTED }; struct remove_plan_action { remove_plan_type type; - std::unique_ptr bpgh; + std::unique_ptr status_pgh; }; struct package_spec_with_remove_plan -- cgit v1.2.3 From 884cd176b05a76e7fbba924685a0d71c3dea0f9b Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:36:27 -0800 Subject: Renames and formatting --- toolsrc/include/vcpkg_Dependencies.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2a3030c89..5b0bf3187 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -16,8 +16,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type type; - std::unique_ptr bpgh; - std::unique_ptr spgh; + std::unique_ptr binary_pgh; + std::unique_ptr source_pgh; }; struct package_spec_with_install_plan -- cgit v1.2.3 From 4d104541674f1975b60c2ccd694d447e25a16359 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 12:45:26 -0800 Subject: Add package_spec::display_name() --- toolsrc/include/package_spec.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/package_spec.h b/toolsrc/include/package_spec.h index b469567c7..1bc493756 100644 --- a/toolsrc/include/package_spec.h +++ b/toolsrc/include/package_spec.h @@ -15,6 +15,8 @@ namespace vcpkg const triplet& target_triplet() const; + std::string display_name() const; + std::string dir() const; std::string toString() const; -- cgit v1.2.3 From e461467affad578d2e13a5c8f18cc37ee3007938 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:57:43 -0800 Subject: [Dependencies] User-requested vs autos-elected info is now in a separate enum --- toolsrc/include/vcpkg_Dependencies.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 5b0bf3187..b987a6b38 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -6,6 +6,12 @@ namespace vcpkg::Dependencies { + enum class request_type + { + USER_REQUESTED, + AUTO_SELECTED + }; + enum class install_plan_type { BUILD_AND_INSTALL, @@ -29,13 +35,13 @@ namespace vcpkg::Dependencies enum class remove_plan_type { NOT_INSTALLED, - REMOVE_AUTO_SELECTED, - REMOVE_USER_REQUESTED + REMOVE }; struct remove_plan_action { - remove_plan_type type; + remove_plan_type plan_type; + request_type request_type; std::unique_ptr status_pgh; }; -- cgit v1.2.3 From b4e9322a11aa2d0d9b0f1c0f960d921ce51e1c0f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 13:58:58 -0800 Subject: Rename field --- toolsrc/include/vcpkg_Dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index b987a6b38..ac4a13e84 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -21,7 +21,7 @@ namespace vcpkg::Dependencies struct install_plan_action { - install_plan_type type; + install_plan_type plan_type; std::unique_ptr binary_pgh; std::unique_ptr source_pgh; }; -- cgit v1.2.3 From 836de4b0748617db6d06b0eef6fe9ccff9980b1f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 15:29:02 -0800 Subject: Fix remove_plan code --- toolsrc/include/vcpkg_Dependencies.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ac4a13e84..9180cb65e 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -42,7 +42,7 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - std::unique_ptr status_pgh; + StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan -- cgit v1.2.3 From 8de71af4bd94ae1e41bf39a455ed716ac8cdf9bc Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:14:48 -0800 Subject: Introduce "optional" alias --- toolsrc/include/vcpkg_Dependencies.h | 5 +++-- toolsrc/include/vcpkg_optional.h | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 toolsrc/include/vcpkg_optional.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 9180cb65e..2595d9fb8 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -3,6 +3,7 @@ #include "package_spec.h" #include "StatusParagraphs.h" #include "vcpkg_paths.h" +#include "vcpkg_optional.h" namespace vcpkg::Dependencies { @@ -22,8 +23,8 @@ namespace vcpkg::Dependencies struct install_plan_action { install_plan_type plan_type; - std::unique_ptr binary_pgh; - std::unique_ptr source_pgh; + optional binary_pgh; + optional source_pgh; }; struct package_spec_with_install_plan diff --git a/toolsrc/include/vcpkg_optional.h b/toolsrc/include/vcpkg_optional.h new file mode 100644 index 000000000..7b935bea9 --- /dev/null +++ b/toolsrc/include/vcpkg_optional.h @@ -0,0 +1,5 @@ +#pragma once +#include + +template +using optional = std::unique_ptr; -- cgit v1.2.3 From 4252d9436e6d4104f6acc5560aef461046aae853 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 16:46:39 -0800 Subject: remove_plan now depends on the spec, instead of StatusParagraph --- toolsrc/include/vcpkg_Dependencies.h | 1 - 1 file changed, 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index 2595d9fb8..ba84d1bd1 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -43,7 +43,6 @@ namespace vcpkg::Dependencies { remove_plan_type plan_type; request_type request_type; - StatusParagraph* status_pgh; }; struct package_spec_with_remove_plan -- cgit v1.2.3 From 4e64dc598a53493a85d65f94c81a33c4862fc89a Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Mon, 30 Jan 2017 17:52:53 -0800 Subject: [Dependencies] Specify constructors and fix bug with default remove_plan_action init --- toolsrc/include/vcpkg_Dependencies.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ba84d1bd1..b63816089 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -9,12 +9,14 @@ namespace vcpkg::Dependencies { enum class request_type { + UNKNOWN, USER_REQUESTED, AUTO_SELECTED }; enum class install_plan_type { + UNKNOWN, BUILD_AND_INSTALL, INSTALL, ALREADY_INSTALLED @@ -22,6 +24,13 @@ namespace vcpkg::Dependencies struct install_plan_action { + install_plan_action(); + install_plan_action(const install_plan_type& plan_type, optional binary_pgh, optional source_pgh); + install_plan_action(const install_plan_action&) = delete; + install_plan_action(install_plan_action&&) = default; + install_plan_action& operator=(const install_plan_action&) = delete; + install_plan_action& operator=(install_plan_action&&) = default; + install_plan_type plan_type; optional binary_pgh; optional source_pgh; @@ -29,24 +38,37 @@ namespace vcpkg::Dependencies struct package_spec_with_install_plan { + package_spec_with_install_plan(const package_spec& spec, install_plan_action&& plan); + package_spec spec; install_plan_action plan; }; enum class remove_plan_type { + UNKNOWN, NOT_INSTALLED, REMOVE }; struct remove_plan_action { + remove_plan_action(); + remove_plan_action(const remove_plan_type& plan_type, const request_type& request_type); + remove_plan_action(const remove_plan_action&) = delete; + remove_plan_action(remove_plan_action&&) = default; + remove_plan_action& operator=(const remove_plan_action&) = delete; + remove_plan_action& operator=(remove_plan_action&&) = default; + + remove_plan_type plan_type; request_type request_type; }; struct package_spec_with_remove_plan { + package_spec_with_remove_plan(const package_spec& spec, remove_plan_action&& plan); + package_spec spec; remove_plan_action plan; }; -- cgit v1.2.3 From 2a83c5eda6288cba46cb723996f95b0f6b21e61f Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 12:59:20 -0800 Subject: [opt_bool] Make members ALL_CAPS --- toolsrc/include/opt_bool.h | 6 +++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 3856366c8..42133fb7a 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -4,8 +4,8 @@ namespace vcpkg { enum class opt_bool { - unspecified, - enabled, - disabled + UNSPECIFIED, + ENABLED, + DISABLED }; } diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 8ace98586..79e12841d 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::unspecified; - opt_bool sendmetrics = opt_bool::unspecified; - opt_bool printmetrics = opt_bool::unspecified; + opt_bool debug = opt_bool::UNSPECIFIED; + opt_bool sendmetrics = opt_bool::UNSPECIFIED; + opt_bool printmetrics = opt_bool::UNSPECIFIED; std::string command; std::vector command_arguments; -- cgit v1.2.3 From bd1a10e5b97b073731cbb97e26611edf317c16d5 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 13:31:45 -0800 Subject: Enhance the opt_bool type --- toolsrc/include/opt_bool.h | 28 +++++++++++++++++++++++++--- toolsrc/include/vcpkg_cmd_arguments.h | 6 +++--- 2 files changed, 28 insertions(+), 6 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/opt_bool.h b/toolsrc/include/opt_bool.h index 42133fb7a..06642a399 100644 --- a/toolsrc/include/opt_bool.h +++ b/toolsrc/include/opt_bool.h @@ -1,11 +1,33 @@ #pragma once -namespace vcpkg +#include +#include + +namespace vcpkg::opt_bool { - enum class opt_bool + enum class type { - UNSPECIFIED, + UNSPECIFIED = 0, ENABLED, DISABLED }; + + type parse(const std::string& s); + + template + type from_map(const std::map& map, const T& key) + { + auto it = map.find(key); + if (it == map.cend()) + { + return type::UNSPECIFIED; + } + + return parse(*it); + } } + +namespace vcpkg +{ + using opt_bool_t = opt_bool::type; +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg_cmd_arguments.h b/toolsrc/include/vcpkg_cmd_arguments.h index 79e12841d..91f7de8ac 100644 --- a/toolsrc/include/vcpkg_cmd_arguments.h +++ b/toolsrc/include/vcpkg_cmd_arguments.h @@ -14,9 +14,9 @@ namespace vcpkg std::unique_ptr vcpkg_root_dir; std::unique_ptr target_triplet; - opt_bool debug = opt_bool::UNSPECIFIED; - opt_bool sendmetrics = opt_bool::UNSPECIFIED; - opt_bool printmetrics = opt_bool::UNSPECIFIED; + opt_bool_t debug = opt_bool_t::UNSPECIFIED; + opt_bool_t sendmetrics = opt_bool_t::UNSPECIFIED; + opt_bool_t printmetrics = opt_bool_t::UNSPECIFIED; std::string command; std::vector command_arguments; -- cgit v1.2.3 From 459999786960483f6d46229524500543459968ed Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 17:09:48 -0800 Subject: Introduce BuildPolicies (not used by the post_build checks yet) --- toolsrc/include/BuildInfo.h | 6 +++++- toolsrc/include/BuildPolicies.h | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 toolsrc/include/BuildPolicies.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h index c90ad7a4e..1fd032aa2 100644 --- a/toolsrc/include/BuildInfo.h +++ b/toolsrc/include/BuildInfo.h @@ -3,6 +3,8 @@ #include #include "Paragraphs.h" #include +#include "BuildPolicies.h" +#include "opt_bool.h" namespace vcpkg::PostBuildLint { @@ -119,10 +121,12 @@ namespace vcpkg::PostBuildLint struct BuildInfo { - static BuildInfo create(const std::unordered_map& pgh); + static BuildInfo create(std::unordered_map pgh); std::string crt_linkage; std::string library_linkage; + + std::map policies; }; BuildInfo read_build_info(const fs::path& filepath); diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h new file mode 100644 index 000000000..fbe9b0ff3 --- /dev/null +++ b/toolsrc/include/BuildPolicies.h @@ -0,0 +1,30 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + static constexpr int length() { return 2; } + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} -- cgit v1.2.3 From c595fac0ffb8de45f390ab591fbc76fa12ca0442 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 31 Jan 2017 18:55:14 -0800 Subject: Add BuildPolicies::values() --- toolsrc/include/BuildPolicies.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h index fbe9b0ff3..8298ffe2d 100644 --- a/toolsrc/include/BuildPolicies.h +++ b/toolsrc/include/BuildPolicies.h @@ -11,7 +11,6 @@ namespace vcpkg::PostBuildLint::BuildPolicies struct type { - static constexpr int length() { return 2; } constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } constexpr operator backing_enum_t() const { return backing_enum; } @@ -23,6 +22,9 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; + static constexpr int value_count = 2; + const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); -- cgit v1.2.3 From 9086fcebdf43ad01892c8f96afc5e676f9b72135 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:24:06 -0800 Subject: Rename files in PostBuildLint namespace --- toolsrc/include/BuildInfo.h | 133 -------------------------- toolsrc/include/BuildPolicies.h | 32 ------- toolsrc/include/PostBuildLint.h | 8 ++ toolsrc/include/PostBuildLint_BuildInfo.h | 133 ++++++++++++++++++++++++++ toolsrc/include/PostBuildLint_BuildPolicies.h | 32 +++++++ toolsrc/include/post_build_lint.h | 8 -- 6 files changed, 173 insertions(+), 173 deletions(-) delete mode 100644 toolsrc/include/BuildInfo.h delete mode 100644 toolsrc/include/BuildPolicies.h create mode 100644 toolsrc/include/PostBuildLint.h create mode 100644 toolsrc/include/PostBuildLint_BuildInfo.h create mode 100644 toolsrc/include/PostBuildLint_BuildPolicies.h delete mode 100644 toolsrc/include/post_build_lint.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/BuildInfo.h b/toolsrc/include/BuildInfo.h deleted file mode 100644 index 1fd032aa2..000000000 --- a/toolsrc/include/BuildInfo.h +++ /dev/null @@ -1,133 +0,0 @@ -#pragma once - -#include -#include "Paragraphs.h" -#include -#include "BuildPolicies.h" -#include "opt_bool.h" - -namespace vcpkg::PostBuildLint -{ - enum class LinkageType - { - DYNAMIC, - STATIC, - UNKNOWN - }; - - LinkageType linkage_type_value_of(const std::string& as_string); - - std::string to_string(const LinkageType& build_info); - - enum class ConfigurationType - { - DEBUG = 1, - RELEASE = 2 - }; - - std::string to_string(const ConfigurationType& conf); - - struct BuildType - { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; - }; - - bool operator ==(const BuildType& lhs, const BuildType& rhs); - - bool operator !=(const BuildType& lhs, const BuildType& rhs); - - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) - { - } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; - - struct BuildInfo - { - static BuildInfo create(std::unordered_map pgh); - - std::string crt_linkage; - std::string library_linkage; - - std::map policies; - }; - - BuildInfo read_build_info(const fs::path& filepath); -} diff --git a/toolsrc/include/BuildPolicies.h b/toolsrc/include/BuildPolicies.h deleted file mode 100644 index 8298ffe2d..000000000 --- a/toolsrc/include/BuildPolicies.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include - -namespace vcpkg::PostBuildLint::BuildPolicies -{ - enum class backing_enum_t - { - UNKNOWN = 0, - DLLS_WITHOUT_LIBS - }; - - struct type - { - constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } - constexpr operator backing_enum_t() const { return backing_enum; } - - const std::string& toString() const; - const std::string& cmake_variable() const; - - private: - type(); - backing_enum_t backing_enum; - }; - - static constexpr int value_count = 2; - const std::vector& values(); - - static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); - static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); - - type parse(const std::string& s); -} diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/PostBuildLint.h new file mode 100644 index 000000000..215a237aa --- /dev/null +++ b/toolsrc/include/PostBuildLint.h @@ -0,0 +1,8 @@ +#pragma once +#include "package_spec.h" +#include "vcpkg_paths.h" + +namespace vcpkg::PostBuildLint +{ + void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); +} diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h new file mode 100644 index 000000000..cf444ce90 --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -0,0 +1,133 @@ +#pragma once + +#include +#include "Paragraphs.h" +#include +#include "PostBuildLint_BuildPolicies.h" +#include "opt_bool.h" + +namespace vcpkg::PostBuildLint +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + std::string to_string(const LinkageType& build_info); + + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); + + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + static const std::vector& values() + { + static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; + return v; + } + + BuildType() = delete; + + const ConfigurationType& config() const; + const LinkageType& linkage() const; + std::regex crt_regex() const; + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) + { + } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); + + struct OutdatedDynamicCrt + { + // Old CPP + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + std::regex crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) + { + } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; + + struct BuildInfo + { + static BuildInfo create(std::unordered_map pgh); + + std::string crt_linkage; + std::string library_linkage; + + std::map policies; + }; + + BuildInfo read_build_info(const fs::path& filepath); +} diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h new file mode 100644 index 000000000..8298ffe2d --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -0,0 +1,32 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint::BuildPolicies +{ + enum class backing_enum_t + { + UNKNOWN = 0, + DLLS_WITHOUT_LIBS + }; + + struct type + { + constexpr explicit type(backing_enum_t backing_enum) : backing_enum(backing_enum) { } + constexpr operator backing_enum_t() const { return backing_enum; } + + const std::string& toString() const; + const std::string& cmake_variable() const; + + private: + type(); + backing_enum_t backing_enum; + }; + + static constexpr int value_count = 2; + const std::vector& values(); + + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); + + type parse(const std::string& s); +} diff --git a/toolsrc/include/post_build_lint.h b/toolsrc/include/post_build_lint.h deleted file mode 100644 index 215a237aa..000000000 --- a/toolsrc/include/post_build_lint.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "package_spec.h" -#include "vcpkg_paths.h" - -namespace vcpkg::PostBuildLint -{ - void perform_all_checks(const package_spec& spec, const vcpkg_paths& paths); -} -- cgit v1.2.3 From 7a04aff33e596b843fba2162ab9b05180fc5169c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:38:02 -0800 Subject: Split LinkageType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 12 +----------- toolsrc/include/PostBuildLint_LinkageType.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 11 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_LinkageType.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index cf444ce90..5305548e1 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,20 +5,10 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" +#include "PostBuildLint_LinkageType.h" namespace vcpkg::PostBuildLint { - enum class LinkageType - { - DYNAMIC, - STATIC, - UNKNOWN - }; - - LinkageType linkage_type_value_of(const std::string& as_string); - - std::string to_string(const LinkageType& build_info); - enum class ConfigurationType { DEBUG = 1, diff --git a/toolsrc/include/PostBuildLint_LinkageType.h b/toolsrc/include/PostBuildLint_LinkageType.h new file mode 100644 index 000000000..7cca97639 --- /dev/null +++ b/toolsrc/include/PostBuildLint_LinkageType.h @@ -0,0 +1,16 @@ +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class LinkageType + { + DYNAMIC, + STATIC, + UNKNOWN + }; + + LinkageType linkage_type_value_of(const std::string& as_string); + + std::string to_string(const LinkageType& build_info); +} -- cgit v1.2.3 From 4aef2485b9d5cf2dfbb30543963e5714dcc411c4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:43:29 -0800 Subject: Split ConfigurationType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 9 +-------- toolsrc/include/PostBuildLint_ConfigurationType.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_ConfigurationType.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 5305548e1..2685b6f7b 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -6,17 +6,10 @@ #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" #include "PostBuildLint_LinkageType.h" +#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - enum class ConfigurationType - { - DEBUG = 1, - RELEASE = 2 - }; - - std::string to_string(const ConfigurationType& conf); - struct BuildType { static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); diff --git a/toolsrc/include/PostBuildLint_ConfigurationType.h b/toolsrc/include/PostBuildLint_ConfigurationType.h new file mode 100644 index 000000000..55dede921 --- /dev/null +++ b/toolsrc/include/PostBuildLint_ConfigurationType.h @@ -0,0 +1,14 @@ +#pragma once +#pragma once +#include + +namespace vcpkg::PostBuildLint +{ + enum class ConfigurationType + { + DEBUG = 1, + RELEASE = 2 + }; + + std::string to_string(const ConfigurationType& conf); +} -- cgit v1.2.3 From 0a0a17b7f9eb2aca7f999de1c4b8c63428e1eadf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:49:28 -0800 Subject: Split BuildType into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 39 --------------------------- toolsrc/include/PostBuildLint_BuildType.h | 45 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_BuildType.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index 2685b6f7b..b41478ef0 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -5,48 +5,9 @@ #include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" -#include "PostBuildLint_LinkageType.h" -#include "PostBuildLint_ConfigurationType.h" namespace vcpkg::PostBuildLint { - struct BuildType - { - static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); - - static const BuildType DEBUG_STATIC; - static const BuildType DEBUG_DYNAMIC; - static const BuildType RELEASE_STATIC; - static const BuildType RELEASE_DYNAMIC; - - static const std::vector& values() - { - static const std::vector v = {DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC}; - return v; - } - - BuildType() = delete; - - const ConfigurationType& config() const; - const LinkageType& linkage() const; - std::regex crt_regex() const; - std::string toString() const; - - private: - BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) - : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) - { - } - - ConfigurationType m_config; - LinkageType m_linkage; - std::string m_crt_regex_as_string; - }; - - bool operator ==(const BuildType& lhs, const BuildType& rhs); - - bool operator !=(const BuildType& lhs, const BuildType& rhs); - struct OutdatedDynamicCrt { // Old CPP diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/PostBuildLint_BuildType.h new file mode 100644 index 000000000..a5cb24f49 --- /dev/null +++ b/toolsrc/include/PostBuildLint_BuildType.h @@ -0,0 +1,45 @@ +#pragma once +#include "PostBuildLint_ConfigurationType.h" +#include "PostBuildLint_LinkageType.h" +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct BuildType + { + static BuildType value_of(const ConfigurationType& config, const LinkageType& linkage); + + static const BuildType DEBUG_STATIC; + static const BuildType DEBUG_DYNAMIC; + static const BuildType RELEASE_STATIC; + static const BuildType RELEASE_DYNAMIC; + + static const std::vector& values() + { + static const std::vector v = { DEBUG_STATIC, DEBUG_DYNAMIC, RELEASE_STATIC, RELEASE_DYNAMIC }; + return v; + } + + BuildType() = delete; + + const ConfigurationType& config() const; + const LinkageType& linkage() const; + std::regex crt_regex() const; + std::string toString() const; + + private: + BuildType(const ConfigurationType& config, const LinkageType& linkage, const std::string& crt_regex_as_string) + : m_config(config), m_linkage(linkage), m_crt_regex_as_string(crt_regex_as_string) + { + } + + ConfigurationType m_config; + LinkageType m_linkage; + std::string m_crt_regex_as_string; + }; + + bool operator ==(const BuildType& lhs, const BuildType& rhs); + + bool operator !=(const BuildType& lhs, const BuildType& rhs); +} -- cgit v1.2.3 From 1d34facb84812bd478f2320857a5a7a3ed327bbf Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 1 Feb 2017 13:54:08 -0800 Subject: Split OutdatedDynamicCrt into separate h/cpp --- toolsrc/include/PostBuildLint_BuildInfo.h | 56 -------------------- toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h | 59 ++++++++++++++++++++++ 2 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_BuildInfo.h b/toolsrc/include/PostBuildLint_BuildInfo.h index b41478ef0..ff996b2b6 100644 --- a/toolsrc/include/PostBuildLint_BuildInfo.h +++ b/toolsrc/include/PostBuildLint_BuildInfo.h @@ -2,67 +2,11 @@ #include #include "Paragraphs.h" -#include #include "PostBuildLint_BuildPolicies.h" #include "opt_bool.h" namespace vcpkg::PostBuildLint { - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) - { - } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; - struct BuildInfo { static BuildInfo create(std::unordered_map pgh); diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h new file mode 100644 index 000000000..484f74cf0 --- /dev/null +++ b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h @@ -0,0 +1,59 @@ +#pragma once +#include +#include + +namespace vcpkg::PostBuildLint +{ + struct OutdatedDynamicCrt + { + // Old CPP + static const OutdatedDynamicCrt MSVCP100_DLL; + static const OutdatedDynamicCrt MSVCP100D_DLL; + static const OutdatedDynamicCrt MSVCP110_DLL; + static const OutdatedDynamicCrt MSVCP110_WIN_DLL; + static const OutdatedDynamicCrt MSVCP120_DLL; + static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCP60_DLL; + static const OutdatedDynamicCrt MSVCP_WIN_DLL; + + // Old C + static const OutdatedDynamicCrt MSVCR100_DLL; + static const OutdatedDynamicCrt MSVCR100D_DLL; + static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCR110_DLL; + static const OutdatedDynamicCrt MSVCR120_DLL; + static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; + static const OutdatedDynamicCrt MSVCRT_DLL; + static const OutdatedDynamicCrt MSVCRT20_DLL; + static const OutdatedDynamicCrt MSVCRT40_DLL; + + static const std::vector& values() + { + static const std::vector v = { + MSVCP100_DLL, MSVCP100D_DLL, + MSVCP110_DLL,MSVCP110_WIN_DLL, + MSVCP120_DLL, MSVCP120_CLR0400_DLL, + MSVCP60_DLL, + MSVCP_WIN_DLL, + + MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, + MSVCR110_DLL, + MSVCR120_DLL, MSVCR120_CLR0400_DLL, + MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL + }; + return v; + } + + OutdatedDynamicCrt() = delete; + + std::regex crt_regex() const; + const std::string& toString() const; + + private: + explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) + : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } + + std::string m_dll_name; + std::string m_crt_regex_as_string; + }; +} -- cgit v1.2.3 From f9616c6994ccf66e2a64e2d62e6a1408694c190c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 17:02:57 -0800 Subject: Add new Policy: Empty Package --- toolsrc/include/PostBuildLint_BuildPolicies.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_BuildPolicies.h b/toolsrc/include/PostBuildLint_BuildPolicies.h index 8298ffe2d..187ba6d64 100644 --- a/toolsrc/include/PostBuildLint_BuildPolicies.h +++ b/toolsrc/include/PostBuildLint_BuildPolicies.h @@ -6,6 +6,7 @@ namespace vcpkg::PostBuildLint::BuildPolicies enum class backing_enum_t { UNKNOWN = 0, + EMPTY_PACKAGE, DLLS_WITHOUT_LIBS }; @@ -22,10 +23,12 @@ namespace vcpkg::PostBuildLint::BuildPolicies backing_enum_t backing_enum; }; - static constexpr int value_count = 2; + static constexpr int value_count = 3; const std::vector& values(); + static constexpr type UNKNOWN(backing_enum_t::UNKNOWN); + static constexpr type EMPTY_PACKAGE(backing_enum_t::EMPTY_PACKAGE); static constexpr type DLLS_WITHOUT_LIBS(backing_enum_t::DLLS_WITHOUT_LIBS); type parse(const std::string& s); -- cgit v1.2.3 From d36a1b7cb0b8be59e7826a7a699d9951e91abc2c Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Tue, 7 Feb 2017 22:57:37 -0800 Subject: Remove OutdatedDynamicCrt enum. Replace with vector --- toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h | 59 ---------------------- 1 file changed, 59 deletions(-) delete mode 100644 toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h (limited to 'toolsrc/include') diff --git a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h b/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h deleted file mode 100644 index 484f74cf0..000000000 --- a/toolsrc/include/PostBuildLint_OutdatedDynamicCrt.h +++ /dev/null @@ -1,59 +0,0 @@ -#pragma once -#include -#include - -namespace vcpkg::PostBuildLint -{ - struct OutdatedDynamicCrt - { - // Old CPP - static const OutdatedDynamicCrt MSVCP100_DLL; - static const OutdatedDynamicCrt MSVCP100D_DLL; - static const OutdatedDynamicCrt MSVCP110_DLL; - static const OutdatedDynamicCrt MSVCP110_WIN_DLL; - static const OutdatedDynamicCrt MSVCP120_DLL; - static const OutdatedDynamicCrt MSVCP120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCP60_DLL; - static const OutdatedDynamicCrt MSVCP_WIN_DLL; - - // Old C - static const OutdatedDynamicCrt MSVCR100_DLL; - static const OutdatedDynamicCrt MSVCR100D_DLL; - static const OutdatedDynamicCrt MSVCR100_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCR110_DLL; - static const OutdatedDynamicCrt MSVCR120_DLL; - static const OutdatedDynamicCrt MSVCR120_CLR0400_DLL; - static const OutdatedDynamicCrt MSVCRT_DLL; - static const OutdatedDynamicCrt MSVCRT20_DLL; - static const OutdatedDynamicCrt MSVCRT40_DLL; - - static const std::vector& values() - { - static const std::vector v = { - MSVCP100_DLL, MSVCP100D_DLL, - MSVCP110_DLL,MSVCP110_WIN_DLL, - MSVCP120_DLL, MSVCP120_CLR0400_DLL, - MSVCP60_DLL, - MSVCP_WIN_DLL, - - MSVCR100_DLL, MSVCR100D_DLL, MSVCR100_CLR0400_DLL, - MSVCR110_DLL, - MSVCR120_DLL, MSVCR120_CLR0400_DLL, - MSVCRT_DLL, MSVCRT20_DLL,MSVCRT40_DLL - }; - return v; - } - - OutdatedDynamicCrt() = delete; - - std::regex crt_regex() const; - const std::string& toString() const; - - private: - explicit OutdatedDynamicCrt(const std::string& dll_name, const std::string& crt_regex_as_string) - : m_dll_name(dll_name), m_crt_regex_as_string(crt_regex_as_string) { } - - std::string m_dll_name; - std::string m_crt_regex_as_string; - }; -} -- cgit v1.2.3