diff --git a/toolsrc/include/Span.h b/toolsrc/include/Span.h deleted file mode 100644 index a43e8f9928..0000000000 --- a/toolsrc/include/Span.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -template -struct Span -{ -public: - using element_type = T; - using pointer = T*; - using reference = T&; - using iterator = T*; - - constexpr Span() noexcept : m_ptr(nullptr), m_count(0) {} - constexpr Span(std::nullptr_t) noexcept : Span() {} - constexpr Span(T* ptr, size_t count) noexcept : m_ptr(ptr), m_count(count) {} - constexpr Span(T* ptr_begin, T* ptr_end) noexcept : m_ptr(ptr_begin), m_count(ptr_end - ptr_begin) {} - constexpr Span(std::initializer_list l) noexcept : m_ptr(l.begin()), m_count(l.size()) {} - - template - constexpr Span(T (&arr)[N]) noexcept : Span(arr, N) - { - } - - Span(std::vector& v) noexcept : Span(v.data(), v.size()) {} - Span(const std::vector>& v) noexcept : Span(v.data(), v.size()) {} - - constexpr iterator begin() const { return m_ptr; } - constexpr iterator end() const { return m_ptr + m_count; } - - constexpr reference operator[](size_t i) const { return m_ptr[i]; } - constexpr size_t size() const { return m_count; } - -private: - pointer m_ptr; - size_t m_count; -}; - -template -Span make_span(std::vector& v) -{ - return {v.data(), v.size()}; -} - -template -Span make_span(const std::vector& v) -{ - return {v.data(), v.size()}; -} diff --git a/toolsrc/include/filesystem_fs.h b/toolsrc/include/filesystem_fs.h deleted file mode 100644 index 0651ebf258..0000000000 --- a/toolsrc/include/filesystem_fs.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -namespace fs -{ - namespace stdfs = std::experimental::filesystem; - - using stdfs::path; - using stdfs::copy_options; - using stdfs::file_status; - - inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } - inline bool is_directory(file_status s) { return stdfs::is_directory(s); } - inline bool status_known(file_status s) { return stdfs::status_known(s); } -} \ No newline at end of file diff --git a/toolsrc/include/pch.h b/toolsrc/include/pch.h index 0f34063f8d..8333eb927c 100644 --- a/toolsrc/include/pch.h +++ b/toolsrc/include/pch.h @@ -2,9 +2,13 @@ #define NOMINMAX #define WIN32_LEAN_AND_MEAN + #pragma warning(suppress : 4768) #include +#pragma warning(suppress : 4768) +#include + #include #include #include @@ -28,10 +32,6 @@ #include #include #include -#pragma warning(push) -#pragma warning(disable : 4768) -#include -#pragma warning(pop) #include #include #include diff --git a/toolsrc/include/vcpkg_Checks.h b/toolsrc/include/vcpkg/base/checks.h similarity index 95% rename from toolsrc/include/vcpkg_Checks.h rename to toolsrc/include/vcpkg/base/checks.h index ce486ac19a..fb162c8970 100644 --- a/toolsrc/include/vcpkg_Checks.h +++ b/toolsrc/include/vcpkg/base/checks.h @@ -1,7 +1,8 @@ #pragma once -#include "LineInfo.h" -#include "vcpkg_Strings.h" +#include +#include +#include namespace vcpkg::Checks { diff --git a/toolsrc/include/vcpkg_Chrono.h b/toolsrc/include/vcpkg/base/chrono.h similarity index 96% rename from toolsrc/include/vcpkg_Chrono.h rename to toolsrc/include/vcpkg/base/chrono.h index c14019ff99..b525852f2f 100644 --- a/toolsrc/include/vcpkg_Chrono.h +++ b/toolsrc/include/vcpkg/base/chrono.h @@ -3,7 +3,7 @@ #include #include -namespace vcpkg +namespace vcpkg::Chrono { class ElapsedTime { diff --git a/toolsrc/include/coff_file_reader.h b/toolsrc/include/vcpkg/base/cofffilereader.h similarity index 81% rename from toolsrc/include/coff_file_reader.h rename to toolsrc/include/vcpkg/base/cofffilereader.h index 7287211a1b..ad2cc7b129 100644 --- a/toolsrc/include/coff_file_reader.h +++ b/toolsrc/include/vcpkg/base/cofffilereader.h @@ -1,6 +1,8 @@ #pragma once -#include "MachineType.h" -#include "filesystem_fs.h" + +#include +#include + #include namespace vcpkg::CoffFileReader diff --git a/toolsrc/include/CStringView.h b/toolsrc/include/vcpkg/base/cstringview.h similarity index 99% rename from toolsrc/include/CStringView.h rename to toolsrc/include/vcpkg/base/cstringview.h index c1810b4f17..341830f053 100644 --- a/toolsrc/include/CStringView.h +++ b/toolsrc/include/vcpkg/base/cstringview.h @@ -1,4 +1,5 @@ #pragma once + #include namespace vcpkg diff --git a/toolsrc/include/vcpkg_Enums.h b/toolsrc/include/vcpkg/base/enums.h similarity index 86% rename from toolsrc/include/vcpkg_Enums.h rename to toolsrc/include/vcpkg/base/enums.h index c75feaa1f4..6eca2cfe16 100644 --- a/toolsrc/include/vcpkg_Enums.h +++ b/toolsrc/include/vcpkg/base/enums.h @@ -1,5 +1,7 @@ #pragma once -#include "LineInfo.h" + +#include + #include namespace vcpkg::Enums diff --git a/toolsrc/include/vcpkg_expected.h b/toolsrc/include/vcpkg/base/expected.h similarity index 94% rename from toolsrc/include/vcpkg_expected.h rename to toolsrc/include/vcpkg/base/expected.h index 9637ec0878..a946c442e1 100644 --- a/toolsrc/include/vcpkg_expected.h +++ b/toolsrc/include/vcpkg/base/expected.h @@ -1,6 +1,7 @@ #pragma once -#include "vcpkg_Checks.h" +#include + #include namespace vcpkg @@ -71,13 +72,13 @@ namespace vcpkg return std::move(this->m_t); } - const T& value_or_exit(const LineInfo& line_info) const & + const T& value_or_exit(const LineInfo& line_info) const& { exit_if_error(line_info); return this->m_t; } - const S& error() const & { return this->m_s.error(); } + const S& error() const& { return this->m_s.error(); } S&& error() && { return std::move(this->m_s.error()); } diff --git a/toolsrc/include/vcpkg_Files.h b/toolsrc/include/vcpkg/base/files.h similarity index 82% rename from toolsrc/include/vcpkg_Files.h rename to toolsrc/include/vcpkg/base/files.h index 855e8ea45c..f4bcf742cd 100644 --- a/toolsrc/include/vcpkg_Files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -1,7 +1,21 @@ #pragma once -#include "filesystem_fs.h" -#include "vcpkg_expected.h" +#include + +#include + +namespace fs +{ + namespace stdfs = std::experimental::filesystem; + + using stdfs::copy_options; + using stdfs::file_status; + using stdfs::path; + + inline bool is_regular_file(file_status s) { return stdfs::is_regular_file(s); } + inline bool is_directory(file_status s) { return stdfs::is_directory(s); } + inline bool status_known(file_status s) { return stdfs::status_known(s); } +} namespace vcpkg::Files { diff --git a/toolsrc/include/vcpkg_Graphs.h b/toolsrc/include/vcpkg/base/graphs.h similarity index 99% rename from toolsrc/include/vcpkg_Graphs.h rename to toolsrc/include/vcpkg/base/graphs.h index 13c0a7136c..ff56cb2985 100644 --- a/toolsrc/include/vcpkg_Graphs.h +++ b/toolsrc/include/vcpkg/base/graphs.h @@ -3,6 +3,8 @@ #include #include +#include + namespace vcpkg::Graphs { enum class ExplorationStatus diff --git a/toolsrc/include/lazy.h b/toolsrc/include/vcpkg/base/lazy.h similarity index 100% rename from toolsrc/include/lazy.h rename to toolsrc/include/vcpkg/base/lazy.h diff --git a/toolsrc/include/LineInfo.h b/toolsrc/include/vcpkg/base/lineinfo.h similarity index 100% rename from toolsrc/include/LineInfo.h rename to toolsrc/include/vcpkg/base/lineinfo.h diff --git a/toolsrc/include/MachineType.h b/toolsrc/include/vcpkg/base/machinetype.h similarity index 99% rename from toolsrc/include/MachineType.h rename to toolsrc/include/vcpkg/base/machinetype.h index 6f61bbd53e..b85cdbb0b8 100644 --- a/toolsrc/include/MachineType.h +++ b/toolsrc/include/vcpkg/base/machinetype.h @@ -1,4 +1,5 @@ #pragma once + #include namespace vcpkg diff --git a/toolsrc/include/vcpkg_optional.h b/toolsrc/include/vcpkg/base/optional.h similarity index 94% rename from toolsrc/include/vcpkg_optional.h rename to toolsrc/include/vcpkg/base/optional.h index 31a2d3e884..ff7a210c78 100644 --- a/toolsrc/include/vcpkg_optional.h +++ b/toolsrc/include/vcpkg/base/optional.h @@ -1,5 +1,6 @@ #pragma once -#include "vcpkg_Checks.h" + +#include namespace vcpkg { @@ -29,7 +30,7 @@ namespace vcpkg return std::move(this->m_t); } - const T& value_or_exit(const LineInfo& line_info) const & + const T& value_or_exit(const LineInfo& line_info) const& { this->exit_if_null(line_info); return this->m_t; @@ -40,7 +41,7 @@ namespace vcpkg constexpr bool has_value() const { return m_is_present; } template - T value_or(U&& default_value) const & + T value_or(U&& default_value) const& { return bool(*this) ? this->m_t : static_cast(std::forward(default_value)); } diff --git a/toolsrc/include/SortedVector.h b/toolsrc/include/vcpkg/base/sortedvector.h similarity index 100% rename from toolsrc/include/SortedVector.h rename to toolsrc/include/vcpkg/base/sortedvector.h diff --git a/toolsrc/include/vcpkg/base/span.h b/toolsrc/include/vcpkg/base/span.h new file mode 100644 index 0000000000..6be546351a --- /dev/null +++ b/toolsrc/include/vcpkg/base/span.h @@ -0,0 +1,60 @@ +#pragma once + +#include +#include +#include +#include + +namespace vcpkg +{ + template + struct Span + { + public: + using element_type = T; + using pointer = T*; + using reference = T&; + using iterator = T*; + + constexpr Span() noexcept : m_ptr(nullptr), m_count(0) {} + constexpr Span(std::nullptr_t) noexcept : Span() {} + constexpr Span(T* ptr, size_t count) noexcept : m_ptr(ptr), m_count(count) {} + constexpr Span(T* ptr_begin, T* ptr_end) noexcept : m_ptr(ptr_begin), m_count(ptr_end - ptr_begin) {} + constexpr Span(std::initializer_list l) noexcept : m_ptr(l.begin()), m_count(l.size()) {} + + template + constexpr Span(T (&arr)[N]) noexcept : Span(arr, N) + { + } + + template + constexpr Span(const std::array, N>& arr) noexcept : Span(arr.data(), arr.size()) + { + } + + Span(std::vector& v) noexcept : Span(v.data(), v.size()) {} + Span(const std::vector>& v) noexcept : Span(v.data(), v.size()) {} + + constexpr iterator begin() const { return m_ptr; } + constexpr iterator end() const { return m_ptr + m_count; } + + constexpr reference operator[](size_t i) const { return m_ptr[i]; } + constexpr size_t size() const { return m_count; } + + private: + pointer m_ptr; + size_t m_count; + }; + + template + Span make_span(std::vector& v) + { + return {v.data(), v.size()}; + } + + template + Span make_span(const std::vector& v) + { + return {v.data(), v.size()}; + } +} \ No newline at end of file diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg/base/strings.h similarity index 96% rename from toolsrc/include/vcpkg_Strings.h rename to toolsrc/include/vcpkg/base/strings.h index c44ce2b99d..59823deb84 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg/base/strings.h @@ -1,6 +1,7 @@ #pragma once -#include "CStringView.h" +#include + #include namespace vcpkg::Strings::details @@ -61,7 +62,7 @@ namespace vcpkg::Strings bool case_insensitive_ascii_contains(const std::string& s, const std::string& pattern); - int case_insensitive_ascii_compare(const CStringView left, const CStringView right); + bool case_insensitive_ascii_compare(const CStringView left, const CStringView right); std::string ascii_to_lowercase(const std::string& input); diff --git a/toolsrc/include/vcpkg_System.h b/toolsrc/include/vcpkg/base/system.h similarity index 97% rename from toolsrc/include/vcpkg_System.h rename to toolsrc/include/vcpkg/base/system.h index 65f80ae6d9..a2e8f3f45b 100644 --- a/toolsrc/include/vcpkg_System.h +++ b/toolsrc/include/vcpkg/base/system.h @@ -1,8 +1,9 @@ #pragma once -#include "filesystem_fs.h" -#include "vcpkg_Strings.h" -#include "vcpkg_optional.h" +#include +#include +#include + #include namespace vcpkg::System diff --git a/toolsrc/include/vcpkg_Util.h b/toolsrc/include/vcpkg/base/util.h similarity index 80% rename from toolsrc/include/vcpkg_Util.h rename to toolsrc/include/vcpkg/base/util.h index facb7dd260..3834580b69 100644 --- a/toolsrc/include/vcpkg_Util.h +++ b/toolsrc/include/vcpkg/base/util.h @@ -56,15 +56,19 @@ namespace vcpkg::Util } template - auto find(const Container& cont, V&& v) + auto find(Container&& cont, V&& v) { - return std::find(cont.cbegin(), cont.cend(), v); + using std::begin; + using std::end; + return std::find(begin(cont), end(cont), v); } template - auto find_if(const Container& cont, Pred pred) + auto find_if(Container&& cont, Pred pred) { - return std::find_if(cont.cbegin(), cont.cend(), pred); + using std::begin; + using std::end; + return std::find_if(begin(cont), end(cont), pred); } template @@ -77,13 +81,15 @@ namespace vcpkg::Util } template - auto find_if_not(const Container& cont, Pred pred) + auto find_if_not(Container&& cont, Pred pred) { - return std::find_if_not(cont.cbegin(), cont.cend(), pred); + using std::begin; + using std::end; + return std::find_if_not(begin(cont), end(cont), pred); } template - void group_by(const Container& cont, std::map>* output, Func f) + void group_by(const Container& cont, _Inout_ std::map>* output, Func&& f) { for (const V& element : cont) { @@ -92,6 +98,12 @@ namespace vcpkg::Util } } + template())->first)>> + std::vector extract_keys(AssocContainer&& input_map) + { + return fmap(input_map, [](auto&& p) { return p.first; }); + } + struct MoveOnlyBase { MoveOnlyBase() = default; diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/vcpkg/binaryparagraph.h similarity index 93% rename from toolsrc/include/BinaryParagraph.h rename to toolsrc/include/vcpkg/binaryparagraph.h index 61e03343a8..7eb50a6d76 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/vcpkg/binaryparagraph.h @@ -1,7 +1,8 @@ #pragma once -#include "PackageSpec.h" -#include "SourceParagraph.h" +#include +#include + #include namespace vcpkg diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg/build.h similarity index 88% rename from toolsrc/include/vcpkg_Build.h rename to toolsrc/include/vcpkg/build.h index 5ba6757576..f146e99512 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg/build.h @@ -1,11 +1,14 @@ #pragma once -#include "CStringView.h" -#include "PackageSpec.h" -#include "StatusParagraphs.h" -#include "VcpkgPaths.h" -#include "vcpkg_Files.h" -#include "vcpkg_optional.h" +#include +#include +#include +#include +#include + +#include +#include +#include #include #include @@ -13,6 +16,16 @@ namespace vcpkg::Build { + namespace Command + { + void perform_and_exit(const FullPackageSpec& full_spec, + const fs::path& port_dir, + const std::unordered_set& options, + const VcpkgPaths& paths); + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + } + enum class UseHeadVersion { NO = 0, diff --git a/toolsrc/include/vcpkg/commands.h b/toolsrc/include/vcpkg/commands.h new file mode 100644 index 0000000000..64b2118ce3 --- /dev/null +++ b/toolsrc/include/vcpkg/commands.h @@ -0,0 +1,134 @@ +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace vcpkg::Commands +{ + using CommandTypeA = void (*)(const VcpkgCmdArguments& args, + const VcpkgPaths& paths, + const Triplet& default_triplet); + using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + using CommandTypeC = void (*)(const VcpkgCmdArguments& args); + + namespace BuildExternal + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + } + + namespace CI + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + } + + namespace Env + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + } + + namespace Create + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Edit + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace DependInfo + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Search + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace List + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Owns + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Cache + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Import + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Integrate + { + extern const char* const INTEGRATE_COMMAND_HELPSTRING; + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace PortsDiff + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Autocomplete + { + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + } + + namespace Version + { + const std::string& version(); + void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); + void perform_and_exit(const VcpkgCmdArguments& args); + } + + namespace Contact + { + const std::string& email(); + void perform_and_exit(const VcpkgCmdArguments& args); + } + + namespace Hash + { + void perform_and_exit(const VcpkgCmdArguments& args); + } + + template + struct PackageNameAndFunction + { + std::string name; + T function; + }; + + Span> get_available_commands_type_a(); + Span> get_available_commands_type_b(); + Span> get_available_commands_type_c(); + + template + T find(const std::string& command_name, const std::vector> available_commands) + { + for (const PackageNameAndFunction& cmd : available_commands) + { + if (cmd.name == command_name) + { + return cmd.function; + } + } + + // not found + return nullptr; + } +} diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg/dependencies.h similarity index 96% rename from toolsrc/include/vcpkg_Dependencies.h rename to toolsrc/include/vcpkg/dependencies.h index d67122e480..2301dbc36b 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg/dependencies.h @@ -1,10 +1,12 @@ #pragma once -#include "PackageSpec.h" -#include "StatusParagraphs.h" -#include "VcpkgPaths.h" -#include "vcpkg_Graphs.h" -#include "vcpkg_Util.h" -#include "vcpkg_optional.h" + +#include +#include +#include +#include +#include +#include + #include namespace vcpkg::Dependencies diff --git a/toolsrc/include/vcpkg/export.h b/toolsrc/include/vcpkg/export.h new file mode 100644 index 0000000000..f3285e1878 --- /dev/null +++ b/toolsrc/include/vcpkg/export.h @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace vcpkg::Export +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + + void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths); +} diff --git a/toolsrc/include/vcpkg_Commands_Export_IFW.h b/toolsrc/include/vcpkg/export.ifw.h similarity index 82% rename from toolsrc/include/vcpkg_Commands_Export_IFW.h rename to toolsrc/include/vcpkg/export.ifw.h index 7bee45eafb..d28a4436dc 100644 --- a/toolsrc/include/vcpkg_Commands_Export_IFW.h +++ b/toolsrc/include/vcpkg/export.ifw.h @@ -1,13 +1,14 @@ #pragma once -#include "VcpkgPaths.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Files.h" +#include +#include + +#include #include #include -namespace vcpkg::Commands::Export::IFW +namespace vcpkg::Export::IFW { struct Options { diff --git a/toolsrc/include/vcpkg_GlobalState.h b/toolsrc/include/vcpkg/globalstate.h similarity index 70% rename from toolsrc/include/vcpkg_GlobalState.h rename to toolsrc/include/vcpkg/globalstate.h index 6522a25bfe..7cea361cf7 100644 --- a/toolsrc/include/vcpkg_GlobalState.h +++ b/toolsrc/include/vcpkg/globalstate.h @@ -1,15 +1,15 @@ #pragma once -#include +#include +#include -#include "vcpkg_Chrono.h" -#include "vcpkg_Util.h" +#include namespace vcpkg { struct GlobalState { - static Util::LockGuarded timer; + static Util::LockGuarded timer; static std::atomic debugging; static std::atomic feature_packages; diff --git a/toolsrc/include/vcpkg/help.h b/toolsrc/include/vcpkg/help.h new file mode 100644 index 0000000000..39ad6912d2 --- /dev/null +++ b/toolsrc/include/vcpkg/help.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +#include + +namespace vcpkg::Help +{ + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); + + void help_topic_valid_triplet(const VcpkgPaths& paths); + + void print_usage(); + + void print_example(const std::string& command_and_arguments); + + std::string create_example_string(const std::string& command_and_arguments); +} diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg/input.h similarity index 94% rename from toolsrc/include/vcpkg_Input.h rename to toolsrc/include/vcpkg/input.h index fa568207a3..6211394271 100644 --- a/toolsrc/include/vcpkg_Input.h +++ b/toolsrc/include/vcpkg/input.h @@ -1,5 +1,6 @@ #pragma once -#include "PackageSpec.h" + +#include namespace vcpkg::Input { diff --git a/toolsrc/include/vcpkg/install.h b/toolsrc/include/vcpkg/install.h new file mode 100644 index 0000000000..02600b7f52 --- /dev/null +++ b/toolsrc/include/vcpkg/install.h @@ -0,0 +1,69 @@ +#pragma once + +#include +#include +#include +#include + +#include + +namespace vcpkg::Install +{ + enum class KeepGoing + { + NO = 0, + YES + }; + + inline KeepGoing to_keep_going(const bool value) { return value ? KeepGoing::YES : KeepGoing::NO; } + + enum class PrintSummary + { + NO = 0, + YES + }; + + inline PrintSummary to_print_summary(const bool value) { return value ? PrintSummary::YES : PrintSummary::NO; } + + struct InstallDir + { + static InstallDir from_destination_root(const fs::path& destination_root, + const std::string& destination_subdirectory, + const fs::path& listfile); + + private: + fs::path m_destination; + std::string m_destination_subdirectory; + fs::path m_listfile; + + public: + const fs::path& destination() const; + const std::string& destination_subdirectory() const; + const fs::path& listfile() const; + }; + + Build::BuildResult perform_install_plan_action(const VcpkgPaths& paths, + const Dependencies::InstallPlanAction& action, + const Build::BuildPackageOptions& install_plan_options, + StatusParagraphs& status_db); + + enum class InstallResult + { + FILE_CONFLICTS, + SUCCESS, + }; + + void install_files_and_write_listfile(Files::Filesystem& fs, const fs::path& source_dir, const InstallDir& dirs); + InstallResult install_package(const VcpkgPaths& paths, + const BinaryControlFile& binary_paragraph, + StatusParagraphs* status_db); + + void perform_and_exit_ex(const std::vector& action_plan, + const Build::BuildPackageOptions& install_plan_options, + const KeepGoing keep_going, + const PrintSummary print_summary, + const VcpkgPaths& paths, + StatusParagraphs& status_db); + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); +} diff --git a/toolsrc/include/metrics.h b/toolsrc/include/vcpkg/metrics.h similarity index 96% rename from toolsrc/include/metrics.h rename to toolsrc/include/vcpkg/metrics.h index 8eae426de5..41be5002d2 100644 --- a/toolsrc/include/metrics.h +++ b/toolsrc/include/vcpkg/metrics.h @@ -1,8 +1,8 @@ #pragma once -#include +#include -#include "vcpkg_Util.h" +#include namespace vcpkg::Metrics { diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/vcpkg/packagespec.h similarity index 96% rename from toolsrc/include/PackageSpec.h rename to toolsrc/include/vcpkg/packagespec.h index c5ce767f90..ee34f14a32 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/vcpkg/packagespec.h @@ -1,8 +1,8 @@ #pragma once -#include "PackageSpecParseResult.h" -#include "Triplet.h" -#include "vcpkg_expected.h" +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/include/PackageSpecParseResult.h b/toolsrc/include/vcpkg/packagespecparseresult.h similarity index 91% rename from toolsrc/include/PackageSpecParseResult.h rename to toolsrc/include/vcpkg/packagespecparseresult.h index 1462b8073d..8a56574fdf 100644 --- a/toolsrc/include/PackageSpecParseResult.h +++ b/toolsrc/include/vcpkg/packagespecparseresult.h @@ -1,6 +1,7 @@ #pragma once -#include "vcpkg_expected.h" +#include +#include namespace vcpkg { diff --git a/toolsrc/include/ParagraphParseResult.h b/toolsrc/include/vcpkg/paragraphparseresult.h similarity index 99% rename from toolsrc/include/ParagraphParseResult.h rename to toolsrc/include/vcpkg/paragraphparseresult.h index eaa7e63274..abdd9eecd1 100644 --- a/toolsrc/include/ParagraphParseResult.h +++ b/toolsrc/include/vcpkg/paragraphparseresult.h @@ -1,4 +1,5 @@ #pragma once + #include namespace vcpkg diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h similarity index 89% rename from toolsrc/include/Paragraphs.h rename to toolsrc/include/vcpkg/paragraphs.h index aae46f7da3..c8dbea6463 100644 --- a/toolsrc/include/Paragraphs.h +++ b/toolsrc/include/vcpkg/paragraphs.h @@ -1,13 +1,13 @@ #pragma once -#include +#include +#include +#include +#include -#include "BinaryParagraph.h" -#include "VcpkgPaths.h" -#include "VersionT.h" -#include "filesystem_fs.h" -#include "vcpkg_Parse.h" -#include "vcpkg_expected.h" +#include + +#include namespace vcpkg::Paragraphs { diff --git a/toolsrc/include/vcpkg_Parse.h b/toolsrc/include/vcpkg/parse.h similarity index 93% rename from toolsrc/include/vcpkg_Parse.h rename to toolsrc/include/vcpkg/parse.h index 2dda033b3d..4b33e302ee 100644 --- a/toolsrc/include/vcpkg_Parse.h +++ b/toolsrc/include/vcpkg/parse.h @@ -1,11 +1,11 @@ #pragma once +#include +#include + #include #include -#include "vcpkg_expected.h" -#include "vcpkg_optional.h" - namespace vcpkg::Parse { struct ParseControlErrorInfo diff --git a/toolsrc/include/PostBuildLint_BuildType.h b/toolsrc/include/vcpkg/postbuildlint.buildtype.h similarity index 96% rename from toolsrc/include/PostBuildLint_BuildType.h rename to toolsrc/include/vcpkg/postbuildlint.buildtype.h index 38ad3084e2..ff651fd7a3 100644 --- a/toolsrc/include/PostBuildLint_BuildType.h +++ b/toolsrc/include/vcpkg/postbuildlint.buildtype.h @@ -1,6 +1,8 @@ #pragma once -#include "CStringView.h" -#include "vcpkg_Build.h" + +#include +#include + #include #include diff --git a/toolsrc/include/PostBuildLint.h b/toolsrc/include/vcpkg/postbuildlint.h similarity index 77% rename from toolsrc/include/PostBuildLint.h rename to toolsrc/include/vcpkg/postbuildlint.h index 69fafc9f71..5dcfeb8dfa 100644 --- a/toolsrc/include/PostBuildLint.h +++ b/toolsrc/include/vcpkg/postbuildlint.h @@ -1,7 +1,8 @@ #pragma once -#include "PackageSpec.h" -#include "VcpkgPaths.h" -#include "vcpkg_Build.h" + +#include +#include +#include namespace vcpkg::PostBuildLint { diff --git a/toolsrc/include/vcpkg/remove.h b/toolsrc/include/vcpkg/remove.h new file mode 100644 index 0000000000..f4d381ca33 --- /dev/null +++ b/toolsrc/include/vcpkg/remove.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include + +namespace vcpkg::Remove +{ + enum class Purge + { + NO = 0, + YES + }; + + inline Purge to_purge(const bool value) { return value ? Purge::YES : Purge::NO; } + + void perform_remove_plan_action(const VcpkgPaths& paths, + const Dependencies::RemovePlanAction& action, + const Purge purge, + StatusParagraphs& status_db); + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); + void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); +} diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h similarity index 94% rename from toolsrc/include/SourceParagraph.h rename to toolsrc/include/vcpkg/sourceparagraph.h index ccf9faf4f7..0a02e4cdab 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/vcpkg/sourceparagraph.h @@ -1,10 +1,11 @@ #pragma once -#include "PackageSpec.h" -#include "Span.h" -#include "vcpkg_Parse.h" -#include "vcpkg_System.h" -#include "vcpkg_expected.h" +#include +#include + +#include +#include +#include #include #include diff --git a/toolsrc/include/StatusParagraph.h b/toolsrc/include/vcpkg/statusparagraph.h similarity index 95% rename from toolsrc/include/StatusParagraph.h rename to toolsrc/include/vcpkg/statusparagraph.h index b56533d65f..ca84b1bb7e 100644 --- a/toolsrc/include/StatusParagraph.h +++ b/toolsrc/include/vcpkg/statusparagraph.h @@ -1,6 +1,7 @@ #pragma once -#include "BinaryParagraph.h" +#include + #include namespace vcpkg diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/vcpkg/statusparagraphs.h similarity index 97% rename from toolsrc/include/StatusParagraphs.h rename to toolsrc/include/vcpkg/statusparagraphs.h index 1a9ee6a03a..c2f3b7b8e5 100644 --- a/toolsrc/include/StatusParagraphs.h +++ b/toolsrc/include/vcpkg/statusparagraphs.h @@ -1,5 +1,6 @@ #pragma once -#include "StatusParagraph.h" +#include + #include #include diff --git a/toolsrc/include/triplet.h b/toolsrc/include/vcpkg/triplet.h similarity index 100% rename from toolsrc/include/triplet.h rename to toolsrc/include/vcpkg/triplet.h diff --git a/toolsrc/include/vcpkg/update.h b/toolsrc/include/vcpkg/update.h new file mode 100644 index 0000000000..e7303d1b06 --- /dev/null +++ b/toolsrc/include/vcpkg/update.h @@ -0,0 +1,21 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace vcpkg::Update +{ + struct OutdatedPackage + { + static bool compare_by_name(const OutdatedPackage& left, const OutdatedPackage& right); + + PackageSpec spec; + VersionDiff version_diff; + }; + + std::vector find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db); + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); +} \ No newline at end of file diff --git a/toolsrc/include/VcpkgCmdArguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h similarity index 98% rename from toolsrc/include/VcpkgCmdArguments.h rename to toolsrc/include/vcpkg/vcpkgcmdarguments.h index 0de5747b10..6c47b98f66 100644 --- a/toolsrc/include/VcpkgCmdArguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -1,6 +1,7 @@ #pragma once -#include "vcpkg_optional.h" +#include + #include #include #include diff --git a/toolsrc/include/vcpkglib.h b/toolsrc/include/vcpkg/vcpkglib.h similarity index 92% rename from toolsrc/include/vcpkglib.h rename to toolsrc/include/vcpkg/vcpkglib.h index 0bb75f9b5b..b2aad8d7bb 100644 --- a/toolsrc/include/vcpkglib.h +++ b/toolsrc/include/vcpkg/vcpkglib.h @@ -1,8 +1,8 @@ #pragma once -#include "SortedVector.h" -#include "StatusParagraphs.h" -#include "VcpkgPaths.h" +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/include/VcpkgPaths.h b/toolsrc/include/vcpkg/vcpkgpaths.h similarity index 93% rename from toolsrc/include/VcpkgPaths.h rename to toolsrc/include/vcpkg/vcpkgpaths.h index a38865a3f9..fb9285a844 100644 --- a/toolsrc/include/VcpkgPaths.h +++ b/toolsrc/include/vcpkg/vcpkgpaths.h @@ -1,10 +1,11 @@ #pragma once -#include "BinaryParagraph.h" -#include "Lazy.h" -#include "PackageSpec.h" -#include "filesystem_fs.h" -#include "vcpkg_Files.h" -#include "vcpkg_expected.h" + +#include +#include + +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/include/VersionT.h b/toolsrc/include/vcpkg/versiont.h similarity index 100% rename from toolsrc/include/VersionT.h rename to toolsrc/include/vcpkg/versiont.h diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h deleted file mode 100644 index c9a33a8f49..0000000000 --- a/toolsrc/include/vcpkg_Commands.h +++ /dev/null @@ -1,258 +0,0 @@ -#pragma once - -#include "StatusParagraphs.h" -#include "VcpkgCmdArguments.h" -#include "VcpkgPaths.h" -#include "VersionT.h" -#include "vcpkg_Build.h" -#include "vcpkg_Dependencies.h" -#include - -namespace vcpkg::Commands -{ - using CommandTypeA = void (*)(const VcpkgCmdArguments& args, - const VcpkgPaths& paths, - const Triplet& default_triplet); - using CommandTypeB = void (*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - using CommandTypeC = void (*)(const VcpkgCmdArguments& args); - - namespace BuildCommand - { - void perform_and_exit(const FullPackageSpec& full_spec, - const fs::path& port_dir, - const std::unordered_set& options, - const VcpkgPaths& paths); - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace BuildExternal - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace Install - { - enum class KeepGoing - { - NO = 0, - YES - }; - - inline KeepGoing to_keep_going(const bool value) { return value ? KeepGoing::YES : KeepGoing::NO; } - - enum class PrintSummary - { - NO = 0, - YES - }; - - inline PrintSummary to_print_summary(const bool value) { return value ? PrintSummary::YES : PrintSummary::NO; } - - struct InstallDir - { - static InstallDir from_destination_root(const fs::path& destination_root, - const std::string& destination_subdirectory, - const fs::path& listfile); - - private: - fs::path m_destination; - std::string m_destination_subdirectory; - fs::path m_listfile; - - public: - const fs::path& destination() const; - const std::string& destination_subdirectory() const; - const fs::path& listfile() const; - }; - - Build::BuildResult perform_install_plan_action(const VcpkgPaths& paths, - const Dependencies::InstallPlanAction& action, - const Build::BuildPackageOptions& install_plan_options, - StatusParagraphs& status_db); - - enum class InstallResult - { - FILE_CONFLICTS, - SUCCESS, - }; - - void install_files_and_write_listfile(Files::Filesystem& fs, - const fs::path& source_dir, - const InstallDir& dirs); - InstallResult install_package(const VcpkgPaths& paths, - const BinaryControlFile& binary_paragraph, - StatusParagraphs* status_db); - - void perform_and_exit(const std::vector& action_plan, - const Build::BuildPackageOptions& install_plan_options, - const KeepGoing keep_going, - const PrintSummary print_summary, - const VcpkgPaths& paths, - StatusParagraphs& status_db); - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace Export - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace CI - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace Remove - { - enum class Purge - { - NO = 0, - YES - }; - - inline Purge to_purge(const bool value) { return value ? Purge::YES : Purge::NO; } - - void perform_remove_plan_action(const VcpkgPaths& paths, - const Dependencies::RemovePlanAction& action, - const Purge purge, - StatusParagraphs& status_db); - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db); - } - - namespace Update - { - struct OutdatedPackage - { - static bool compare_by_name(const OutdatedPackage& left, const OutdatedPackage& right); - - PackageSpec spec; - VersionDiff version_diff; - }; - - std::vector find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db); - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Env - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet); - } - - namespace Create - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Edit - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace DependInfo - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Search - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace List - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Owns - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Cache - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Import - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Integrate - { - extern const char* const INTEGRATE_COMMAND_HELPSTRING; - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace PortsDiff - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Autocomplete - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - } - - namespace Help - { - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths); - - void help_topic_valid_triplet(const VcpkgPaths& paths); - - void print_usage(); - - void print_example(const std::string& command_and_arguments); - - std::string create_example_string(const std::string& command_and_arguments); - } - - namespace Version - { - const std::string& version(); - void warn_if_vcpkg_version_mismatch(const VcpkgPaths& paths); - void perform_and_exit(const VcpkgCmdArguments& args); - } - - namespace Contact - { - const std::string& email(); - void perform_and_exit(const VcpkgCmdArguments& args); - } - - namespace Hash - { - void perform_and_exit(const VcpkgCmdArguments& args); - } - - template - struct PackageNameAndFunction - { - std::string name; - T function; - }; - - const std::vector>& get_available_commands_type_a(); - const std::vector>& get_available_commands_type_b(); - const std::vector>& get_available_commands_type_c(); - - template - T find(const std::string& command_name, const std::vector> available_commands) - { - for (const PackageNameAndFunction& cmd : available_commands) - { - if (cmd.name == command_name) - { - return cmd.function; - } - } - - // not found - return nullptr; - } -} diff --git a/toolsrc/include/vcpkg_Commands_Export.h b/toolsrc/include/vcpkg_Commands_Export.h deleted file mode 100644 index 6e698c1b4d..0000000000 --- a/toolsrc/include/vcpkg_Commands_Export.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "VcpkgPaths.h" - -namespace vcpkg::Commands::Export -{ - void export_integration_files(const fs::path& raw_exported_dir_path, const VcpkgPaths& paths); -} diff --git a/toolsrc/include/vcpkg_Maps.h b/toolsrc/include/vcpkg_Maps.h deleted file mode 100644 index aadd81c2b6..0000000000 --- a/toolsrc/include/vcpkg_Maps.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace vcpkg::Maps -{ - 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; - } - - 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; - } -} diff --git a/toolsrc/src/commands_build.cpp b/toolsrc/src/commands_build.cpp deleted file mode 100644 index a69958058b..0000000000 --- a/toolsrc/src/commands_build.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "pch.h" - -#include "Paragraphs.h" -#include "PostBuildLint.h" -#include "StatusParagraphs.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Enums.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" - -using vcpkg::Build::BuildResult; -using vcpkg::Parse::ParseControlErrorInfo; -using vcpkg::Parse::ParseExpected; - -namespace vcpkg::Commands::BuildCommand -{ - using Dependencies::InstallPlanAction; - using Dependencies::InstallPlanType; - - static const std::string OPTION_CHECKS_ONLY = "--checks-only"; - - void perform_and_exit(const FullPackageSpec& full_spec, - const fs::path& port_dir, - const std::unordered_set& options, - const VcpkgPaths& paths) - { - const PackageSpec& spec = full_spec.package_spec; - if (options.find(OPTION_CHECKS_ONLY) != options.end()) - { - const auto pre_build_info = Build::PreBuildInfo::from_triplet_file(paths, spec.triplet()); - const auto build_info = Build::read_build_info(paths.get_filesystem(), paths.build_info_file_path(spec)); - const size_t error_count = PostBuildLint::perform_all_checks(spec, paths, pre_build_info, build_info); - Checks::check_exit(VCPKG_LINE_INFO, error_count == 0); - Checks::exit_success(VCPKG_LINE_INFO); - } - - const ParseExpected source_control_file = - Paragraphs::try_load_port(paths.get_filesystem(), port_dir); - - if (!source_control_file.has_value()) - { - print_error_message(source_control_file.error()); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - for (const std::string& str : full_spec.features) - { - System::println("%s \n", str); - } - const auto& scf = source_control_file.value_or_exit(VCPKG_LINE_INFO); - Checks::check_exit(VCPKG_LINE_INFO, - spec.name() == scf->core_paragraph->name, - "The Name: field inside the CONTROL does not match the port directory: '%s' != '%s'", - scf->core_paragraph->name, - spec.name()); - - const StatusParagraphs status_db = database_load_check(paths); - const Build::BuildPackageOptions build_package_options{Build::UseHeadVersion::NO, Build::AllowDownloads::YES}; - - const Build::BuildPackageConfig build_config{ - *scf->core_paragraph, spec.triplet(), paths.port_dir(spec), build_package_options}; - - const auto result = Build::build_package(paths, build_config, status_db); - if (result.code == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) - { - System::println(System::Color::error, - "The build command requires all dependencies to be already installed."); - System::println("The following dependencies are missing:"); - System::println(); - for (const auto& p : result.unmet_dependencies) - { - System::println(" %s", p); - } - System::println(); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - if (result.code != BuildResult::SUCCEEDED) - { - System::println(System::Color::error, Build::create_error_message(result.code, spec)); - System::println(Build::create_user_troubleshooting_message(spec)); - Checks::exit_fail(VCPKG_LINE_INFO); - } - - Checks::exit_success(VCPKG_LINE_INFO); - } - - void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) - { - static const std::string EXAMPLE = Commands::Help::create_example_string("build zlib:x64-windows"); - // Build only takes a single package and all dependencies must already be installed - args.check_exact_arg_count(1, EXAMPLE); - const std::string command_argument = args.command_arguments.at(0); - const FullPackageSpec spec = Input::check_and_get_full_package_spec(command_argument, default_triplet, EXAMPLE); - Input::check_triplet(spec.package_spec.triplet(), paths); - const std::unordered_set options = - args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); - perform_and_exit(spec, paths.port_dir(spec.package_spec), options, paths); - } -} diff --git a/toolsrc/src/tests_arguments.cpp b/toolsrc/src/tests.arguments.cpp similarity index 95% rename from toolsrc/src/tests_arguments.cpp rename to toolsrc/src/tests.arguments.cpp index 14b3c3d4fd..25bf0f085c 100644 --- a/toolsrc/src/tests_arguments.cpp +++ b/toolsrc/src/tests.arguments.cpp @@ -1,5 +1,5 @@ -#include "CppUnitTest.h" -#include "VcpkgCmdArguments.h" +#include +#include #pragma comment(lib, "version") #pragma comment(lib, "winhttp") diff --git a/toolsrc/src/tests_dependencies.cpp b/toolsrc/src/tests.dependencies.cpp similarity index 98% rename from toolsrc/src/tests_dependencies.cpp rename to toolsrc/src/tests.dependencies.cpp index 6a6981d73b..3f6e0dd103 100644 --- a/toolsrc/src/tests_dependencies.cpp +++ b/toolsrc/src/tests.dependencies.cpp @@ -1,6 +1,6 @@ -#include "CppUnitTest.h" -#include "SourceParagraph.h" -#include "Triplet.h" +#include +#include +#include #pragma comment(lib, "version") #pragma comment(lib, "winhttp") diff --git a/toolsrc/src/test_install_plan.cpp b/toolsrc/src/tests.installplan.cpp similarity index 99% rename from toolsrc/src/test_install_plan.cpp rename to toolsrc/src/tests.installplan.cpp index 6c93112646..120009db5d 100644 --- a/toolsrc/src/test_install_plan.cpp +++ b/toolsrc/src/tests.installplan.cpp @@ -1,6 +1,7 @@ -#include "CppUnitTest.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Util.h" +#include +#include + +#include using namespace Microsoft::VisualStudio::CppUnitTestFramework; diff --git a/toolsrc/src/tests_package_spec.cpp b/toolsrc/src/tests.packagespec.cpp similarity index 97% rename from toolsrc/src/tests_package_spec.cpp rename to toolsrc/src/tests.packagespec.cpp index a6b9d5b134..cb5c41af07 100644 --- a/toolsrc/src/tests_package_spec.cpp +++ b/toolsrc/src/tests.packagespec.cpp @@ -1,7 +1,8 @@ -#include "BinaryParagraph.h" -#include "CppUnitTest.h" -#include "Paragraphs.h" -#include "vcpkg_Strings.h" +#include +#include +#include + +#include #pragma comment(lib, "version") #pragma comment(lib, "winhttp") diff --git a/toolsrc/src/tests_paragraph.cpp b/toolsrc/src/tests.paragraph.cpp similarity index 99% rename from toolsrc/src/tests_paragraph.cpp rename to toolsrc/src/tests.paragraph.cpp index 47a07e12dd..d9301abd04 100644 --- a/toolsrc/src/tests_paragraph.cpp +++ b/toolsrc/src/tests.paragraph.cpp @@ -1,7 +1,8 @@ -#include "BinaryParagraph.h" -#include "CppUnitTest.h" -#include "Paragraphs.h" -#include "vcpkg_Strings.h" +#include +#include +#include + +#include #pragma comment(lib, "version") #pragma comment(lib, "winhttp") diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index 706c641fbf..748b4f0ee8 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -1,16 +1,18 @@ #define WIN32_LEAN_AND_MEAN #include -#include "Paragraphs.h" -#include "metrics.h" -#include "vcpkg_Chrono.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Files.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_Input.h" -#include "vcpkg_Strings.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #pragma warning(push) #pragma warning(disable : 4768) #include @@ -19,12 +21,15 @@ #include #include +#pragma comment(lib, "ole32") +#pragma comment(lib, "shell32") + using namespace vcpkg; void invalid_command(const std::string& cmd) { System::println(System::Color::error, "invalid command: %s", cmd); - Commands::Help::print_usage(); + Help::print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -33,13 +38,26 @@ static void inner(const VcpkgCmdArguments& args) Metrics::g_metrics.lock()->track_property("command", args.command); if (args.command.empty()) { - Commands::Help::print_usage(); + Help::print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } - if (const auto command_function = Commands::find(args.command, Commands::get_available_commands_type_c())) + static const auto find_command = [&](auto&& commands) { + auto it = Util::find_if(commands, [&](auto&& commandc) { + return Strings::case_insensitive_ascii_compare(commandc.name, args.command); + }); + using std::end; + if (it != end(commands)) + { + return &*it; + } + else + return static_cast(nullptr); + }; + + if (const auto command_function = find_command(Commands::get_available_commands_type_c())) { - return command_function(args); + return command_function->function(args); } fs::path vcpkg_root_dir; @@ -74,9 +92,9 @@ static void inner(const VcpkgCmdArguments& args) Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Changing the working dir failed"); Commands::Version::warn_if_vcpkg_version_mismatch(paths); - if (const auto command_function = Commands::find(args.command, Commands::get_available_commands_type_b())) + if (const auto command_function = find_command(Commands::get_available_commands_type_b())) { - return command_function(args, paths); + return command_function->function(args, paths); } Triplet default_triplet; @@ -100,9 +118,9 @@ static void inner(const VcpkgCmdArguments& args) Input::check_triplet(default_triplet, paths); - if (const auto command_function = Commands::find(args.command, Commands::get_available_commands_type_a())) + if (const auto command_function = find_command(Commands::get_available_commands_type_a())) { - return command_function(args, paths, default_triplet); + return command_function->function(args, paths, default_triplet); } return invalid_command(args.command); @@ -202,7 +220,7 @@ int wmain(const int argc, const wchar_t* const* const argv) SetConsoleCP(65001); SetConsoleOutputCP(65001); - *GlobalState::timer.lock() = ElapsedTime::create_started(); + *GlobalState::timer.lock() = Chrono::ElapsedTime::create_started(); const std::string trimmed_command_line = trim_path_from_command_line(Strings::to_utf8(GetCommandLineW())); diff --git a/toolsrc/src/vcpkg_Checks.cpp b/toolsrc/src/vcpkg/base/checks.cpp similarity index 94% rename from toolsrc/src/vcpkg_Checks.cpp rename to toolsrc/src/vcpkg/base/checks.cpp index e7c9046a4b..73c7b9b1a1 100644 --- a/toolsrc/src/vcpkg_Checks.cpp +++ b/toolsrc/src/vcpkg/base/checks.cpp @@ -1,10 +1,10 @@ #include "pch.h" -#include "metrics.h" -#include "vcpkg_Checks.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include + +#include +#include namespace vcpkg::Checks { diff --git a/toolsrc/src/vcpkg_Chrono.cpp b/toolsrc/src/vcpkg/base/chrono.cpp similarity index 95% rename from toolsrc/src/vcpkg_Chrono.cpp rename to toolsrc/src/vcpkg/base/chrono.cpp index d96f309877..5d28909fc9 100644 --- a/toolsrc/src/vcpkg_Chrono.cpp +++ b/toolsrc/src/vcpkg/base/chrono.cpp @@ -1,9 +1,9 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Chrono.h" +#include +#include -namespace vcpkg +namespace vcpkg::Chrono { static std::string format_time_userfriendly(const std::chrono::nanoseconds& nanos) { diff --git a/toolsrc/src/coff_file_reader.cpp b/toolsrc/src/vcpkg/base/cofffilereader.cpp similarity index 99% rename from toolsrc/src/coff_file_reader.cpp rename to toolsrc/src/vcpkg/base/cofffilereader.cpp index bb3a6cefdd..5e9c869981 100644 --- a/toolsrc/src/coff_file_reader.cpp +++ b/toolsrc/src/vcpkg/base/cofffilereader.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "coff_file_reader.h" -#include "vcpkg_Checks.h" +#include +#include using namespace std; diff --git a/toolsrc/src/vcpkg_Enums.cpp b/toolsrc/src/vcpkg/base/enums.cpp similarity index 85% rename from toolsrc/src/vcpkg_Enums.cpp rename to toolsrc/src/vcpkg/base/enums.cpp index 51ba9d5dcd..aa124f3aa9 100644 --- a/toolsrc/src/vcpkg_Enums.cpp +++ b/toolsrc/src/vcpkg/base/enums.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Enums.h" +#include +#include namespace vcpkg::Enums { diff --git a/toolsrc/src/vcpkg_Files.cpp b/toolsrc/src/vcpkg/base/files.cpp similarity index 98% rename from toolsrc/src/vcpkg_Files.cpp rename to toolsrc/src/vcpkg/base/files.cpp index ad1fcebc6a..f8b239eaa9 100644 --- a/toolsrc/src/vcpkg_Files.cpp +++ b/toolsrc/src/vcpkg/base/files.cpp @@ -1,9 +1,8 @@ #include "pch.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include +#include +#include +#include namespace vcpkg::Files { diff --git a/toolsrc/src/LineInfo.cpp b/toolsrc/src/vcpkg/base/lineinfo.cpp similarity index 70% rename from toolsrc/src/LineInfo.cpp rename to toolsrc/src/vcpkg/base/lineinfo.cpp index d1bf9a4b15..7435ed6664 100644 --- a/toolsrc/src/LineInfo.cpp +++ b/toolsrc/src/vcpkg/base/lineinfo.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "LineInfo.h" -#include "vcpkg_Strings.h" +#include +#include namespace vcpkg { diff --git a/toolsrc/src/MachineType.cpp b/toolsrc/src/vcpkg/base/machinetype.cpp similarity index 94% rename from toolsrc/src/MachineType.cpp rename to toolsrc/src/vcpkg/base/machinetype.cpp index af6378c889..2b7bd5e3a5 100644 --- a/toolsrc/src/MachineType.cpp +++ b/toolsrc/src/vcpkg/base/machinetype.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "MachineType.h" -#include "vcpkg_Checks.h" +#include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg_Strings.cpp b/toolsrc/src/vcpkg/base/strings.cpp similarity index 95% rename from toolsrc/src/vcpkg_Strings.cpp rename to toolsrc/src/vcpkg/base/strings.cpp index bbe6b29cd8..2a6d3dff2d 100644 --- a/toolsrc/src/vcpkg_Strings.cpp +++ b/toolsrc/src/vcpkg/base/strings.cpp @@ -1,8 +1,8 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Strings.h" -#include "vcpkg_Util.h" +#include +#include +#include namespace vcpkg::Strings::details { @@ -104,9 +104,9 @@ namespace vcpkg::Strings return case_insensitive_ascii_find(s, pattern) != s.end(); } - int case_insensitive_ascii_compare(const CStringView left, const CStringView right) + bool case_insensitive_ascii_compare(const CStringView left, const CStringView right) { - return _stricmp(left.c_str(), right.c_str()); + return _stricmp(left.c_str(), right.c_str()) == 0; } std::string ascii_to_lowercase(const std::string& input) diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg/base/system.cpp similarity index 97% rename from toolsrc/src/vcpkg_System.cpp rename to toolsrc/src/vcpkg/base/system.cpp index 5293638e3c..d5d39461c6 100644 --- a/toolsrc/src/vcpkg_System.cpp +++ b/toolsrc/src/vcpkg/base/system.cpp @@ -1,9 +1,10 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include + +#pragma comment(lib, "Advapi32") namespace vcpkg::System { @@ -26,11 +27,11 @@ namespace vcpkg::System Optional to_cpu_architecture(CStringView arch) { - if (Strings::case_insensitive_ascii_compare(arch, "x86") == 0) return CPUArchitecture::X86; - if (Strings::case_insensitive_ascii_compare(arch, "x64") == 0) return CPUArchitecture::X64; - if (Strings::case_insensitive_ascii_compare(arch, "amd64") == 0) return CPUArchitecture::X64; - if (Strings::case_insensitive_ascii_compare(arch, "arm") == 0) return CPUArchitecture::ARM; - if (Strings::case_insensitive_ascii_compare(arch, "arm64") == 0) return CPUArchitecture::ARM64; + if (Strings::case_insensitive_ascii_compare(arch, "x86")) return CPUArchitecture::X86; + if (Strings::case_insensitive_ascii_compare(arch, "x64")) return CPUArchitecture::X64; + if (Strings::case_insensitive_ascii_compare(arch, "amd64")) return CPUArchitecture::X64; + if (Strings::case_insensitive_ascii_compare(arch, "arm")) return CPUArchitecture::ARM; + if (Strings::case_insensitive_ascii_compare(arch, "arm64")) return CPUArchitecture::ARM64; return nullopt; } diff --git a/toolsrc/src/BinaryParagraph.cpp b/toolsrc/src/vcpkg/binaryparagraph.cpp similarity index 98% rename from toolsrc/src/BinaryParagraph.cpp rename to toolsrc/src/vcpkg/binaryparagraph.cpp index 1504912ab3..ef943011f6 100644 --- a/toolsrc/src/BinaryParagraph.cpp +++ b/toolsrc/src/vcpkg/binaryparagraph.cpp @@ -1,8 +1,8 @@ #include "pch.h" -#include "BinaryParagraph.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Parse.h" +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg_Build.cpp b/toolsrc/src/vcpkg/build.cpp similarity index 72% rename from toolsrc/src/vcpkg_Build.cpp rename to toolsrc/src/vcpkg/build.cpp index 9be20629d9..99ec541c1f 100644 --- a/toolsrc/src/vcpkg_Build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -1,20 +1,147 @@ #include "pch.h" -#include "Paragraphs.h" -#include "PostBuildLint.h" -#include "metrics.h" -#include "vcpkg_Build.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Chrono.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Enums.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_System.h" -#include "vcpkg_optional.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using vcpkg::Build::BuildResult; +using vcpkg::Parse::ParseControlErrorInfo; +using vcpkg::Parse::ParseExpected; + +namespace vcpkg::Build::Command +{ + using Dependencies::InstallPlanAction; + using Dependencies::InstallPlanType; + + static const std::string OPTION_CHECKS_ONLY = "--checks-only"; + + void perform_and_exit(const FullPackageSpec& full_spec, + const fs::path& port_dir, + const std::unordered_set& options, + const VcpkgPaths& paths) + { + const PackageSpec& spec = full_spec.package_spec; + if (options.find(OPTION_CHECKS_ONLY) != options.end()) + { + const auto pre_build_info = Build::PreBuildInfo::from_triplet_file(paths, spec.triplet()); + const auto build_info = Build::read_build_info(paths.get_filesystem(), paths.build_info_file_path(spec)); + const size_t error_count = PostBuildLint::perform_all_checks(spec, paths, pre_build_info, build_info); + Checks::check_exit(VCPKG_LINE_INFO, error_count == 0); + Checks::exit_success(VCPKG_LINE_INFO); + } + + const ParseExpected source_control_file = + Paragraphs::try_load_port(paths.get_filesystem(), port_dir); + + if (!source_control_file.has_value()) + { + print_error_message(source_control_file.error()); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + for (const std::string& str : full_spec.features) + { + System::println("%s \n", str); + } + const auto& scf = source_control_file.value_or_exit(VCPKG_LINE_INFO); + Checks::check_exit(VCPKG_LINE_INFO, + spec.name() == scf->core_paragraph->name, + "The Name: field inside the CONTROL does not match the port directory: '%s' != '%s'", + scf->core_paragraph->name, + spec.name()); + + const StatusParagraphs status_db = database_load_check(paths); + const Build::BuildPackageOptions build_package_options{Build::UseHeadVersion::NO, Build::AllowDownloads::YES}; + + const Build::BuildPackageConfig build_config{ + *scf->core_paragraph, spec.triplet(), paths.port_dir(spec), build_package_options}; + + const auto result = Build::build_package(paths, build_config, status_db); + if (result.code == BuildResult::CASCADED_DUE_TO_MISSING_DEPENDENCIES) + { + System::println(System::Color::error, + "The build command requires all dependencies to be already installed."); + System::println("The following dependencies are missing:"); + System::println(); + for (const auto& p : result.unmet_dependencies) + { + System::println(" %s", p); + } + System::println(); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + if (result.code != BuildResult::SUCCEEDED) + { + System::println(System::Color::error, Build::create_error_message(result.code, spec)); + System::println(Build::create_user_troubleshooting_message(spec)); + Checks::exit_fail(VCPKG_LINE_INFO); + } + + Checks::exit_success(VCPKG_LINE_INFO); + } + + void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) + { + static const std::string EXAMPLE = Help::create_example_string("build zlib:x64-windows"); + // Build only takes a single package and all dependencies must already be installed + args.check_exact_arg_count(1, EXAMPLE); + const std::string command_argument = args.command_arguments.at(0); + const FullPackageSpec spec = Input::check_and_get_full_package_spec(command_argument, default_triplet, EXAMPLE); + Input::check_triplet(spec.package_spec.triplet(), paths); + const std::unordered_set options = + args.check_and_get_optional_command_arguments({OPTION_CHECKS_ONLY}); + perform_and_exit(spec, paths.port_dir(spec.package_spec), options, paths); + } +} namespace vcpkg::Build { + static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; + static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; + static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT"; + static const std::string NAME_EMPTY_INCLUDE_FOLDER = "PolicyEmptyIncludeFolder"; + static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt"; + + const std::string& to_string(BuildPolicy policy) + { + switch (policy) + { + case BuildPolicy::EMPTY_PACKAGE: return NAME_EMPTY_PACKAGE; + case BuildPolicy::DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; + case BuildPolicy::ONLY_RELEASE_CRT: return NAME_ONLY_RELEASE_CRT; + case BuildPolicy::EMPTY_INCLUDE_FOLDER: return NAME_EMPTY_INCLUDE_FOLDER; + case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + + CStringView to_cmake_variable(BuildPolicy policy) + { + switch (policy) + { + case BuildPolicy::EMPTY_PACKAGE: return "VCPKG_POLICY_EMPTY_PACKAGE"; + case BuildPolicy::DLLS_WITHOUT_LIBS: return "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; + case BuildPolicy::ONLY_RELEASE_CRT: return "VCPKG_POLICY_ONLY_RELEASE_CRT"; + case BuildPolicy::EMPTY_INCLUDE_FOLDER: return "VCPKG_POLICY_EMPTY_INCLUDE_FOLDER"; + case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT"; + default: Checks::unreachable(VCPKG_LINE_INFO); + } + } + Optional to_linkage_type(const std::string& str) { if (str == "dynamic") return LinkageType::DYNAMIC; @@ -174,7 +301,7 @@ namespace vcpkg::Build const std::wstring command = Strings::wformat(LR"(%s && %s)", cmd_set_environment, cmd_launch_cmake); - const ElapsedTime timer = ElapsedTime::create_started(); + const auto timer = Chrono::ElapsedTime::create_started(); const int return_code = System::cmd_execute_clean(command); const auto buildtimeus = timer.microseconds(); diff --git a/toolsrc/src/commands_autocomplete.cpp b/toolsrc/src/vcpkg/commands.autocomplete.cpp similarity index 96% rename from toolsrc/src/commands_autocomplete.cpp rename to toolsrc/src/vcpkg/commands.autocomplete.cpp index 6ded74f9b9..b8c6331428 100644 --- a/toolsrc/src/commands_autocomplete.cpp +++ b/toolsrc/src/vcpkg/commands.autocomplete.cpp @@ -1,11 +1,10 @@ #include "pch.h" -#include "Paragraphs.h" -#include "metrics.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" -#include +#include +#include +#include +#include +#include namespace vcpkg::Commands::Autocomplete { diff --git a/toolsrc/src/commands_build_external.cpp b/toolsrc/src/vcpkg/commands.buildexternal.cpp similarity index 70% rename from toolsrc/src/commands_build_external.cpp rename to toolsrc/src/vcpkg/commands.buildexternal.cpp index 7e85f22507..3991beb626 100644 --- a/toolsrc/src/commands_build_external.cpp +++ b/toolsrc/src/vcpkg/commands.buildexternal.cpp @@ -1,14 +1,16 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Input.h" +#include +#include +#include +#include namespace vcpkg::Commands::BuildExternal { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { static const std::string EXAMPLE = - Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); + Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"); args.check_exact_arg_count(2, EXAMPLE); const FullPackageSpec spec = Input::check_and_get_full_package_spec(args.command_arguments.at(0), default_triplet, EXAMPLE); @@ -16,6 +18,6 @@ namespace vcpkg::Commands::BuildExternal const std::unordered_set options = args.check_and_get_optional_command_arguments({}); const fs::path port_dir = args.command_arguments.at(1); - BuildCommand::perform_and_exit(spec, port_dir, options, paths); + Build::Command::perform_and_exit(spec, port_dir, options, paths); } } diff --git a/toolsrc/src/commands_cache.cpp b/toolsrc/src/vcpkg/commands.cache.cpp similarity index 90% rename from toolsrc/src/commands_cache.cpp rename to toolsrc/src/vcpkg/commands.cache.cpp index 5b65b197fe..77f0a20f67 100644 --- a/toolsrc/src/commands_cache.cpp +++ b/toolsrc/src/vcpkg/commands.cache.cpp @@ -1,10 +1,11 @@ #include "pch.h" -#include "BinaryParagraph.h" -#include "Paragraphs.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" +#include +#include +#include +#include +#include +#include namespace vcpkg::Commands::Cache { @@ -29,7 +30,7 @@ namespace vcpkg::Commands::Cache { static const std::string EXAMPLE = Strings::format( "The argument should be a substring to search for, or no argument to display all cached libraries.\n%s", - Commands::Help::create_example_string("cache png")); + Help::create_example_string("cache png")); args.check_max_arg_count(1, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_ci.cpp b/toolsrc/src/vcpkg/commands.ci.cpp similarity index 83% rename from toolsrc/src/commands_ci.cpp rename to toolsrc/src/vcpkg/commands.ci.cpp index 75ff655562..1c98d1d836 100644 --- a/toolsrc/src/commands_ci.cpp +++ b/toolsrc/src/vcpkg/commands.ci.cpp @@ -1,15 +1,17 @@ #include "pch.h" -#include "Paragraphs.h" -#include "vcpkg_Build.h" -#include "vcpkg_Chrono.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Files.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace vcpkg::Commands::CI { @@ -30,7 +32,7 @@ namespace vcpkg::Commands::CI void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { - static const std::string EXAMPLE = Commands::Help::create_example_string("ci x64-windows"); + static const std::string EXAMPLE = Help::create_example_string("ci x64-windows"); args.check_max_arg_count(1, EXAMPLE); const Triplet triplet = args.command_arguments.size() == 1 ? Triplet::from_canonical_name(args.command_arguments.at(0)) @@ -52,7 +54,7 @@ namespace vcpkg::Commands::CI return Dependencies::AnyAction(std::move(install_action)); }); - Install::perform_and_exit( + Install::perform_and_exit_ex( action_plan, install_plan_options, Install::KeepGoing::YES, Install::PrintSummary::YES, paths, status_db); Checks::exit_success(VCPKG_LINE_INFO); diff --git a/toolsrc/src/commands_contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp similarity index 89% rename from toolsrc/src/commands_contact.cpp rename to toolsrc/src/vcpkg/commands.contact.cpp index 8374350eea..421b8a2300 100644 --- a/toolsrc/src/commands_contact.cpp +++ b/toolsrc/src/vcpkg/commands.contact.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" +#include +#include namespace vcpkg::Commands::Contact { diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/vcpkg/commands.cpp similarity index 75% rename from toolsrc/src/commands_available_commands.cpp rename to toolsrc/src/vcpkg/commands.cpp index d3280e6d79..9d969ea28d 100644 --- a/toolsrc/src/commands_available_commands.cpp +++ b/toolsrc/src/vcpkg/commands.cpp @@ -1,16 +1,22 @@ #include "pch.h" -#include "vcpkg_Commands.h" +#include +#include +#include +#include +#include +#include +#include namespace vcpkg::Commands { - const std::vector>& get_available_commands_type_a() + Span> get_available_commands_type_a() { static std::vector> t = { {"install", &Install::perform_and_exit}, {"ci", &CI::perform_and_exit}, {"remove", &Remove::perform_and_exit}, - {"build", &BuildCommand::perform_and_exit}, + {"build", &Build::Command::perform_and_exit}, {"env", &Env::perform_and_exit}, {"build-external", &BuildExternal::perform_and_exit}, {"export", &Export::perform_and_exit}, @@ -18,7 +24,7 @@ namespace vcpkg::Commands return t; } - const std::vector>& get_available_commands_type_b() + Span> get_available_commands_type_b() { static std::vector> t = { {"/?", &Help::perform_and_exit}, @@ -38,7 +44,7 @@ namespace vcpkg::Commands return t; } - const std::vector>& get_available_commands_type_c() + Span> get_available_commands_type_c() { static std::vector> t = { {"version", &Version::perform_and_exit}, diff --git a/toolsrc/src/commands_create.cpp b/toolsrc/src/vcpkg/commands.create.cpp similarity index 87% rename from toolsrc/src/commands_create.cpp rename to toolsrc/src/vcpkg/commands.create.cpp index 6898f7399b..d923cf555f 100644 --- a/toolsrc/src/commands_create.cpp +++ b/toolsrc/src/vcpkg/commands.create.cpp @@ -1,15 +1,16 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include namespace vcpkg::Commands::Create { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const std::string EXAMPLE = Commands::Help::create_example_string( + static const std::string EXAMPLE = Help::create_example_string( R"###(create zlib2 http://zlib.net/zlib1211.zip "zlib1211-2.zip")###"); args.check_max_arg_count(3, EXAMPLE); args.check_min_arg_count(2, EXAMPLE); diff --git a/toolsrc/src/commands_depends.cpp b/toolsrc/src/vcpkg/commands.dependinfo.cpp similarity index 88% rename from toolsrc/src/commands_depends.cpp rename to toolsrc/src/vcpkg/commands.dependinfo.cpp index 17cd9c881b..89c7e0c7fe 100644 --- a/toolsrc/src/commands_depends.cpp +++ b/toolsrc/src/vcpkg/commands.dependinfo.cpp @@ -1,16 +1,17 @@ #include "pch.h" -#include "Paragraphs.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Strings.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" +#include +#include +#include +#include +#include +#include namespace vcpkg::Commands::DependInfo { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const std::string EXAMPLE = Commands::Help::create_example_string(R"###(depend-info [pat])###"); + static const std::string EXAMPLE = Help::create_example_string(R"###(depend-info [pat])###"); args.check_max_arg_count(1, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp similarity index 95% rename from toolsrc/src/commands_edit.cpp rename to toolsrc/src/vcpkg/commands.edit.cpp index 823c87534f..9497bd76e7 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -1,8 +1,9 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" +#include +#include +#include +#include namespace vcpkg::Commands::Edit { @@ -38,7 +39,7 @@ namespace vcpkg::Commands::Edit auto& fs = paths.get_filesystem(); - static const std::string EXAMPLE = Commands::Help::create_example_string("edit zlib"); + static const std::string EXAMPLE = Help::create_example_string("edit zlib"); args.check_exact_arg_count(1, EXAMPLE); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_BUILDTREES}); diff --git a/toolsrc/src/commands_env.cpp b/toolsrc/src/vcpkg/commands.env.cpp similarity index 75% rename from toolsrc/src/commands_env.cpp rename to toolsrc/src/vcpkg/commands.env.cpp index 6dad3e882f..0898815882 100644 --- a/toolsrc/src/commands_env.cpp +++ b/toolsrc/src/vcpkg/commands.env.cpp @@ -1,14 +1,15 @@ #include "pch.h" -#include "vcpkg_Build.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" +#include +#include +#include +#include namespace vcpkg::Commands::Env { void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet) { - static const std::string EXAMPLE = Commands::Help::create_example_string(R"(env --Triplet x64-windows)"); + static const std::string EXAMPLE = Help::create_example_string(R"(env --triplet x64-windows)"); args.check_exact_arg_count(0, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_export_ifw.cpp b/toolsrc/src/vcpkg/commands.exportifw.cpp similarity index 99% rename from toolsrc/src/commands_export_ifw.cpp rename to toolsrc/src/vcpkg/commands.exportifw.cpp index c001a93edf..fbf3beb8c9 100644 --- a/toolsrc/src/commands_export_ifw.cpp +++ b/toolsrc/src/vcpkg/commands.exportifw.cpp @@ -1,10 +1,11 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Commands_Export.h" -#include "vcpkg_Commands_Export_IFW.h" +#include +#include +#include +#include -namespace vcpkg::Commands::Export::IFW +namespace vcpkg::Export::IFW { using Dependencies::ExportPlanAction; using Dependencies::ExportPlanType; diff --git a/toolsrc/src/commands_hash.cpp b/toolsrc/src/vcpkg/commands.hash.cpp similarity index 84% rename from toolsrc/src/commands_hash.cpp rename to toolsrc/src/vcpkg/commands.hash.cpp index b3211b9f8a..394a02e23b 100644 --- a/toolsrc/src/commands_hash.cpp +++ b/toolsrc/src/vcpkg/commands.hash.cpp @@ -1,8 +1,9 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" +#include +#include +#include +#include namespace vcpkg::Commands::Hash { @@ -34,9 +35,8 @@ namespace vcpkg::Commands::Hash void perform_and_exit(const VcpkgCmdArguments& args) { - static const std::string EXAMPLE = - Strings::format("The argument should be a file path\n%s", - Commands::Help::create_example_string("hash boost_1_62_0.tar.bz2")); + static const std::string EXAMPLE = Strings::format("The argument should be a file path\n%s", + Help::create_example_string("hash boost_1_62_0.tar.bz2")); args.check_min_arg_count(1, EXAMPLE); args.check_max_arg_count(2, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_import.cpp b/toolsrc/src/vcpkg/commands.import.cpp similarity index 95% rename from toolsrc/src/commands_import.cpp rename to toolsrc/src/vcpkg/commands.import.cpp index 412a03d7fe..119aee022a 100644 --- a/toolsrc/src/commands_import.cpp +++ b/toolsrc/src/vcpkg/commands.import.cpp @@ -1,9 +1,10 @@ #include "pch.h" -#include "Paragraphs.h" -#include "StatusParagraph.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Files.h" +#include +#include +#include +#include +#include namespace vcpkg::Commands::Import { @@ -93,7 +94,7 @@ namespace vcpkg::Commands::Import void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const std::string EXAMPLE = Commands::Help::create_example_string( + static const std::string EXAMPLE = Help::create_example_string( R"(import C:\path\to\CONTROLfile C:\path\to\includedir C:\path\to\projectdir)"); args.check_exact_arg_count(3, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_integrate.cpp b/toolsrc/src/vcpkg/commands.integrate.cpp similarity index 98% rename from toolsrc/src/commands_integrate.cpp rename to toolsrc/src/vcpkg/commands.integrate.cpp index fd2f112944..7f6639222c 100644 --- a/toolsrc/src/commands_integrate.cpp +++ b/toolsrc/src/vcpkg/commands.integrate.cpp @@ -1,10 +1,10 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" +#include +#include +#include +#include +#include namespace vcpkg::Commands::Integrate { diff --git a/toolsrc/src/commands_list.cpp b/toolsrc/src/vcpkg/commands.list.cpp similarity index 94% rename from toolsrc/src/commands_list.cpp rename to toolsrc/src/vcpkg/commands.list.cpp index 6408858609..d0e8e00b4e 100644 --- a/toolsrc/src/commands_list.cpp +++ b/toolsrc/src/vcpkg/commands.list.cpp @@ -1,8 +1,9 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include namespace vcpkg::Commands::List { @@ -27,7 +28,7 @@ namespace vcpkg::Commands::List { static const std::string EXAMPLE = Strings::format( "The argument should be a substring to search for, or no argument to display all installed libraries.\n%s", - Commands::Help::create_example_string("list png")); + Help::create_example_string("list png")); args.check_max_arg_count(1, EXAMPLE); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_FULLDESC}); diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/vcpkg/commands.owns.cpp similarity index 85% rename from toolsrc/src/commands_owns.cpp rename to toolsrc/src/vcpkg/commands.owns.cpp index 718a0277ff..69079e8296 100644 --- a/toolsrc/src/commands_owns.cpp +++ b/toolsrc/src/vcpkg/commands.owns.cpp @@ -1,8 +1,9 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include namespace vcpkg::Commands::Owns { @@ -26,7 +27,7 @@ namespace vcpkg::Commands::Owns void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { static const std::string EXAMPLE = Strings::format("The argument should be a pattern to search for. %s", - Commands::Help::create_example_string("owns zlib.dll")); + Help::create_example_string("owns zlib.dll")); args.check_exact_arg_count(1, EXAMPLE); args.check_and_get_optional_command_arguments({}); diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/vcpkg/commands.portsdiff.cpp similarity index 93% rename from toolsrc/src/commands_portsdiff.cpp rename to toolsrc/src/vcpkg/commands.portsdiff.cpp index 2334b2270c..b70ad2b80e 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/vcpkg/commands.portsdiff.cpp @@ -1,10 +1,12 @@ #include "pch.h" -#include "Paragraphs.h" -#include "SortedVector.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Maps.h" -#include "vcpkg_System.h" +#include +#include +#include + +#include +#include +#include namespace vcpkg::Commands::PortsDiff { @@ -116,9 +118,8 @@ namespace vcpkg::Commands::PortsDiff void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const std::string EXAMPLE = - Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", - Commands::Help::create_example_string("portsdiff mybranchname")); + static const std::string EXAMPLE = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", + Help::create_example_string("portsdiff mybranchname")); args.check_min_arg_count(1, EXAMPLE); args.check_max_arg_count(2, EXAMPLE); args.check_and_get_optional_command_arguments({}); @@ -138,8 +139,8 @@ namespace vcpkg::Commands::PortsDiff read_ports_from_commit(paths, git_commit_id_for_previous_snapshot); // Already sorted, so set_difference can work on std::vector too - const std::vector current_ports = Maps::extract_keys(current_names_and_versions); - const std::vector previous_ports = Maps::extract_keys(previous_names_and_versions); + const std::vector current_ports = Util::extract_keys(current_names_and_versions); + const std::vector previous_ports = Util::extract_keys(previous_names_and_versions); const SetElementPresence setp = SetElementPresence::create(current_ports, previous_ports); diff --git a/toolsrc/src/commands_search.cpp b/toolsrc/src/vcpkg/commands.search.cpp similarity index 95% rename from toolsrc/src/commands_search.cpp rename to toolsrc/src/vcpkg/commands.search.cpp index d35a546c4e..3ba8707de6 100644 --- a/toolsrc/src/commands_search.cpp +++ b/toolsrc/src/vcpkg/commands.search.cpp @@ -1,11 +1,12 @@ #include "pch.h" -#include "Paragraphs.h" -#include "SourceParagraph.h" -#include "vcpkg_Commands.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include namespace vcpkg::Commands::Search { @@ -82,7 +83,7 @@ namespace vcpkg::Commands::Search { static const std::string EXAMPLE = Strings::format( "The argument should be a substring to search for, or no argument to display all libraries.\n%s", - Commands::Help::create_example_string("search png")); + Help::create_example_string("search png")); args.check_max_arg_count(1, EXAMPLE); const std::unordered_set options = args.check_and_get_optional_command_arguments({OPTION_GRAPH, OPTION_FULLDESC}); diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/vcpkg/commands.version.cpp similarity index 96% rename from toolsrc/src/commands_version.cpp rename to toolsrc/src/vcpkg/commands.version.cpp index 5744ea9eff..c6cc82d1f4 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/vcpkg/commands.version.cpp @@ -1,8 +1,8 @@ #include "pch.h" -#include "metrics.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" +#include +#include +#include #define STRINGIFY(...) #__VA_ARGS__ #define MACRO_TO_STRING(X) STRINGIFY(X) diff --git a/toolsrc/src/vcpkg_Dependencies.cpp b/toolsrc/src/vcpkg/dependencies.cpp similarity index 98% rename from toolsrc/src/vcpkg_Dependencies.cpp rename to toolsrc/src/vcpkg/dependencies.cpp index 8dd60a2eb5..da8f1e1787 100644 --- a/toolsrc/src/vcpkg_Dependencies.cpp +++ b/toolsrc/src/vcpkg/dependencies.cpp @@ -1,15 +1,15 @@ #include "pch.h" -#include "PackageSpec.h" -#include "Paragraphs.h" -#include "StatusParagraphs.h" -#include "VcpkgPaths.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Files.h" -#include "vcpkg_Graphs.h" -#include "vcpkg_Strings.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace vcpkg::Dependencies { diff --git a/toolsrc/src/commands_export.cpp b/toolsrc/src/vcpkg/export.cpp similarity index 98% rename from toolsrc/src/commands_export.cpp rename to toolsrc/src/vcpkg/export.cpp index 20838f5a50..de6464c87d 100644 --- a/toolsrc/src/commands_export.cpp +++ b/toolsrc/src/vcpkg/export.cpp @@ -1,16 +1,19 @@ #include "pch.h" -#include "Paragraphs.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Commands_Export_IFW.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include -namespace vcpkg::Commands::Export +namespace vcpkg::Export { using Dependencies::ExportPlanAction; using Dependencies::ExportPlanType; @@ -273,8 +276,7 @@ namespace vcpkg::Commands::Export static const std::string OPTION_IFW_INSTALLER_FILE_PATH = "--ifw-installer-file-path"; // input sanitization - static const std::string EXAMPLE = - Commands::Help::create_example_string("export zlib zlib:x64-windows boost --nuget"); + static const std::string EXAMPLE = Help::create_example_string("export zlib zlib:x64-windows boost --nuget"); args.check_min_arg_count(1, EXAMPLE); ret.specs = Util::fmap(args.command_arguments, [&](auto&& arg) { diff --git a/toolsrc/src/vcpkg_GlobalState.cpp b/toolsrc/src/vcpkg/globalstate.cpp similarity index 74% rename from toolsrc/src/vcpkg_GlobalState.cpp rename to toolsrc/src/vcpkg/globalstate.cpp index 2221222c00..de564d3578 100644 --- a/toolsrc/src/vcpkg_GlobalState.cpp +++ b/toolsrc/src/vcpkg/globalstate.cpp @@ -1,10 +1,10 @@ #include "pch.h" -#include "vcpkg_GlobalState.h" +#include namespace vcpkg { - Util::LockGuarded GlobalState::timer; + Util::LockGuarded GlobalState::timer; std::atomic GlobalState::debugging = false; std::atomic GlobalState::feature_packages = false; diff --git a/toolsrc/src/commands_help.cpp b/toolsrc/src/vcpkg/help.cpp similarity index 95% rename from toolsrc/src/commands_help.cpp rename to toolsrc/src/vcpkg/help.cpp index a12f9003d9..7867f71d29 100644 --- a/toolsrc/src/commands_help.cpp +++ b/toolsrc/src/vcpkg/help.cpp @@ -1,9 +1,9 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" +#include +#include -namespace vcpkg::Commands::Help +namespace vcpkg::Help { void help_topics() { @@ -75,7 +75,7 @@ namespace vcpkg::Commands::Help " (default: %%VCPKG_ROOT%%)\n" "\n" "For more help (including examples) see the accompanying README.md.", - Integrate::INTEGRATE_COMMAND_HELPSTRING); + Commands::Integrate::INTEGRATE_COMMAND_HELPSTRING); } std::string create_example_string(const std::string& command_and_arguments) @@ -114,7 +114,7 @@ namespace vcpkg::Commands::Help { System::print("Commands:\n" "%s", - Integrate::INTEGRATE_COMMAND_HELPSTRING); + Commands::Integrate::INTEGRATE_COMMAND_HELPSTRING); } else if (topic == "topics") { diff --git a/toolsrc/src/vcpkg_Input.cpp b/toolsrc/src/vcpkg/input.cpp similarity index 91% rename from toolsrc/src/vcpkg_Input.cpp rename to toolsrc/src/vcpkg/input.cpp index f1cac9632a..aee0fac7f0 100644 --- a/toolsrc/src/vcpkg_Input.cpp +++ b/toolsrc/src/vcpkg/input.cpp @@ -1,9 +1,10 @@ #include "pch.h" -#include "metrics.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" +#include +#include +#include +#include +#include namespace vcpkg::Input { @@ -30,7 +31,7 @@ namespace vcpkg::Input { System::println(System::Color::error, "Error: invalid triplet: %s", t); Metrics::g_metrics.lock()->track_property("error", "invalid triplet: " + t.to_string()); - Commands::Help::help_topic_valid_triplet(paths); + Help::help_topic_valid_triplet(paths); Checks::exit_fail(VCPKG_LINE_INFO); } } diff --git a/toolsrc/src/commands_install.cpp b/toolsrc/src/vcpkg/install.cpp similarity index 95% rename from toolsrc/src/commands_install.cpp rename to toolsrc/src/vcpkg/install.cpp index 4411dd3ae6..28d6d1cc64 100644 --- a/toolsrc/src/commands_install.cpp +++ b/toolsrc/src/vcpkg/install.cpp @@ -1,18 +1,21 @@ #include "pch.h" -#include "Paragraphs.h" -#include "metrics.h" -#include "vcpkg_Build.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Files.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -namespace vcpkg::Commands::Install +namespace vcpkg::Install { using namespace Dependencies; @@ -68,8 +71,8 @@ namespace vcpkg::Commands::Install const std::string filename = file.filename().generic_string(); if (fs::is_regular_file(status) && - (Strings::case_insensitive_ascii_compare(filename.c_str(), "CONTROL") == 0 || - Strings::case_insensitive_ascii_compare(filename.c_str(), "BUILD_INFO") == 0)) + (Strings::case_insensitive_ascii_compare(filename.c_str(), "CONTROL") || + Strings::case_insensitive_ascii_compare(filename.c_str(), "BUILD_INFO"))) { // Do not copy the control file continue; @@ -442,22 +445,22 @@ namespace vcpkg::Commands::Install } } - void perform_and_exit(const std::vector& action_plan, - const Build::BuildPackageOptions& install_plan_options, - const KeepGoing keep_going, - const PrintSummary print_summary, - const VcpkgPaths& paths, - StatusParagraphs& status_db) + void perform_and_exit_ex(const std::vector& action_plan, + const Build::BuildPackageOptions& install_plan_options, + const KeepGoing keep_going, + const PrintSummary print_summary, + const VcpkgPaths& paths, + StatusParagraphs& status_db) { std::vector results; std::vector timing; - const ElapsedTime timer = ElapsedTime::create_started(); + const auto timer = Chrono::ElapsedTime::create_started(); size_t counter = 0; const size_t package_count = action_plan.size(); for (const auto& action : action_plan) { - const ElapsedTime build_timer = ElapsedTime::create_started(); + const auto build_timer = Chrono::ElapsedTime::create_started(); counter++; const std::string display_name = action.spec().to_string(); @@ -531,8 +534,7 @@ namespace vcpkg::Commands::Install static const std::string OPTION_KEEP_GOING = "--keep-going"; // input sanitization - static const std::string EXAMPLE = - Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost"); + static const std::string EXAMPLE = Help::create_example_string("install zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, EXAMPLE); const std::vector specs = Util::fmap(args.command_arguments, [&](auto&& arg) { @@ -607,7 +609,7 @@ namespace vcpkg::Commands::Install Checks::exit_success(VCPKG_LINE_INFO); } - perform_and_exit(action_plan, install_plan_options, keep_going, print_summary, paths, status_db); + perform_and_exit_ex(action_plan, install_plan_options, keep_going, print_summary, paths, status_db); Checks::exit_success(VCPKG_LINE_INFO); } diff --git a/toolsrc/src/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp similarity index 98% rename from toolsrc/src/metrics.cpp rename to toolsrc/src/vcpkg/metrics.cpp index 8a0050bfce..84c1ee2084 100644 --- a/toolsrc/src/metrics.cpp +++ b/toolsrc/src/vcpkg/metrics.cpp @@ -1,10 +1,13 @@ #include "pch.h" -#include "filesystem_fs.h" -#include "metrics.h" -#include "vcpkg_Files.h" -#include "vcpkg_Strings.h" -#include "vcpkg_System.h" +#include + +#include +#include +#include + +#pragma comment(lib, "version") +#pragma comment(lib, "winhttp") namespace vcpkg::Metrics { diff --git a/toolsrc/src/PackageSpec.cpp b/toolsrc/src/vcpkg/packagespec.cpp similarity index 98% rename from toolsrc/src/PackageSpec.cpp rename to toolsrc/src/vcpkg/packagespec.cpp index 890de8899e..01a09618d4 100644 --- a/toolsrc/src/PackageSpec.cpp +++ b/toolsrc/src/vcpkg/packagespec.cpp @@ -1,8 +1,8 @@ #include "pch.h" -#include "PackageSpec.h" -#include "vcpkg_Parse.h" -#include "vcpkg_Util.h" +#include +#include +#include using vcpkg::Parse::parse_comma_list; diff --git a/toolsrc/src/PackageSpecParseResult.cpp b/toolsrc/src/vcpkg/packagespecparseresult.cpp similarity index 88% rename from toolsrc/src/PackageSpecParseResult.cpp rename to toolsrc/src/vcpkg/packagespecparseresult.cpp index 838c788bae..b12bd12d04 100644 --- a/toolsrc/src/PackageSpecParseResult.cpp +++ b/toolsrc/src/vcpkg/packagespecparseresult.cpp @@ -1,7 +1,8 @@ #include "pch.h" -#include "PackageSpecParseResult.h" -#include "vcpkg_Checks.h" +#include + +#include namespace vcpkg { diff --git a/toolsrc/src/ParagraphParseResult.cpp b/toolsrc/src/vcpkg/paragraphparseresult.cpp similarity index 93% rename from toolsrc/src/ParagraphParseResult.cpp rename to toolsrc/src/vcpkg/paragraphparseresult.cpp index 5c8c1d59de..920a4b16b0 100644 --- a/toolsrc/src/ParagraphParseResult.cpp +++ b/toolsrc/src/vcpkg/paragraphparseresult.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "ParagraphParseResult.h" -#include "vcpkg_Checks.h" +#include +#include namespace vcpkg { diff --git a/toolsrc/src/Paragraphs.cpp b/toolsrc/src/vcpkg/paragraphs.cpp similarity index 98% rename from toolsrc/src/Paragraphs.cpp rename to toolsrc/src/vcpkg/paragraphs.cpp index 6a6f191df9..b93de190c5 100644 --- a/toolsrc/src/Paragraphs.cpp +++ b/toolsrc/src/vcpkg/paragraphs.cpp @@ -1,10 +1,10 @@ #include "pch.h" -#include "ParagraphParseResult.h" -#include "Paragraphs.h" -#include "vcpkg_Files.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_Util.h" +#include +#include +#include +#include +#include using namespace vcpkg::Parse; diff --git a/toolsrc/src/vcpkg_Parse.cpp b/toolsrc/src/vcpkg/parse.cpp similarity index 93% rename from toolsrc/src/vcpkg_Parse.cpp rename to toolsrc/src/vcpkg/parse.cpp index e671a1a051..116a7f5c81 100644 --- a/toolsrc/src/vcpkg_Parse.cpp +++ b/toolsrc/src/vcpkg/parse.cpp @@ -1,8 +1,9 @@ #include "pch.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Maps.h" -#include "vcpkg_Parse.h" +#include + +#include +#include namespace vcpkg::Parse { @@ -38,7 +39,7 @@ namespace vcpkg::Parse { auto err = std::make_unique(); err->name = name; - err->extra_fields = Maps::extract_keys(fields); + err->extra_fields = Util::extract_keys(fields); err->missing_fields = std::move(missing_fields); return err; } diff --git a/toolsrc/src/PostBuildLint_BuildType.cpp b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp similarity index 97% rename from toolsrc/src/PostBuildLint_BuildType.cpp rename to toolsrc/src/vcpkg/postbuildlint.buildtype.cpp index 649f0cccaa..2baaddb5e8 100644 --- a/toolsrc/src/PostBuildLint_BuildType.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.buildtype.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "PostBuildLint_BuildType.h" -#include "vcpkg_Checks.h" +#include +#include namespace vcpkg::PostBuildLint { diff --git a/toolsrc/src/PostBuildLint.cpp b/toolsrc/src/vcpkg/postbuildlint.cpp similarity index 99% rename from toolsrc/src/PostBuildLint.cpp rename to toolsrc/src/vcpkg/postbuildlint.cpp index 6d9a0da73c..22cf67e86b 100644 --- a/toolsrc/src/PostBuildLint.cpp +++ b/toolsrc/src/vcpkg/postbuildlint.cpp @@ -1,14 +1,14 @@ #include "pch.h" -#include "PackageSpec.h" -#include "PostBuildLint.h" -#include "PostBuildLint_BuildType.h" -#include "VcpkgPaths.h" -#include "coff_file_reader.h" -#include "vcpkg_Build.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include using vcpkg::Build::BuildInfo; using vcpkg::Build::BuildPolicy; @@ -696,8 +696,8 @@ namespace vcpkg::PostBuildLint std::vector misplaced_files = fs.get_files_non_recursive(dir); Util::unstable_keep_if(misplaced_files, [&fs](const fs::path& path) { const std::string filename = path.filename().generic_string(); - if (Strings::case_insensitive_ascii_compare(filename.c_str(), "CONTROL") == 0 || - Strings::case_insensitive_ascii_compare(filename.c_str(), "BUILD_INFO") == 0) + if (Strings::case_insensitive_ascii_compare(filename.c_str(), "CONTROL") || + Strings::case_insensitive_ascii_compare(filename.c_str(), "BUILD_INFO")) return false; return !fs.is_directory(path); }); diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/vcpkg/remove.cpp similarity index 96% rename from toolsrc/src/commands_remove.cpp rename to toolsrc/src/vcpkg/remove.cpp index a9f1b25649..3751566f76 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/vcpkg/remove.cpp @@ -1,13 +1,16 @@ #include "pch.h" -#include "vcpkg_Commands.h" -#include "vcpkg_Dependencies.h" -#include "vcpkg_Input.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -namespace vcpkg::Commands::Remove +namespace vcpkg::Remove { using Dependencies::RemovePlanAction; using Dependencies::RemovePlanType; @@ -167,8 +170,7 @@ namespace vcpkg::Commands::Remove static const std::string OPTION_RECURSE = "--recurse"; static const std::string OPTION_DRY_RUN = "--dry-run"; static const std::string OPTION_OUTDATED = "--outdated"; - static const std::string EXAMPLE = - Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); + static const std::string EXAMPLE = Help::create_example_string("remove zlib zlib:x64-windows curl boost"); const std::unordered_set options = args.check_and_get_optional_command_arguments( {OPTION_PURGE, OPTION_NO_PURGE, OPTION_RECURSE, OPTION_DRY_RUN, OPTION_OUTDATED}); diff --git a/toolsrc/src/SourceParagraph.cpp b/toolsrc/src/vcpkg/sourceparagraph.cpp similarity index 86% rename from toolsrc/src/SourceParagraph.cpp rename to toolsrc/src/vcpkg/sourceparagraph.cpp index 0f1a38d190..d766dcb72d 100644 --- a/toolsrc/src/SourceParagraph.cpp +++ b/toolsrc/src/vcpkg/sourceparagraph.cpp @@ -1,19 +1,19 @@ #include "pch.h" -#include "PackageSpec.h" -#include "SourceParagraph.h" -#include "Triplet.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Maps.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkg_expected.h" +#include +#include +#include + +#include +#include +#include +#include namespace vcpkg { using namespace vcpkg::Parse; - namespace Fields + namespace SourceParagraphFields { static const std::string BUILD_DEPENDS = "Build-Depends"; static const std::string DEFAULTFEATURES = "Default-Features"; @@ -28,11 +28,11 @@ namespace vcpkg static Span get_list_of_valid_fields() { static const std::string valid_fields[] = { - Fields::SOURCE, - Fields::VERSION, - Fields::DESCRIPTION, - Fields::MAINTAINER, - Fields::BUILD_DEPENDS, + SourceParagraphFields::SOURCE, + SourceParagraphFields::VERSION, + SourceParagraphFields::DESCRIPTION, + SourceParagraphFields::MAINTAINER, + SourceParagraphFields::BUILD_DEPENDS, }; return valid_fields; @@ -92,14 +92,15 @@ namespace vcpkg auto spgh = std::make_unique(); - parser.required_field(Fields::SOURCE, spgh->name); - parser.required_field(Fields::VERSION, spgh->version); + parser.required_field(SourceParagraphFields::SOURCE, spgh->name); + parser.required_field(SourceParagraphFields::VERSION, spgh->version); - spgh->description = parser.optional_field(Fields::DESCRIPTION); - spgh->maintainer = parser.optional_field(Fields::MAINTAINER); - spgh->depends = expand_qualified_dependencies(parse_comma_list(parser.optional_field(Fields::BUILD_DEPENDS))); - spgh->supports = parse_comma_list(parser.optional_field(Fields::SUPPORTS)); - spgh->default_features = parse_comma_list(parser.optional_field(Fields::DEFAULTFEATURES)); + spgh->description = parser.optional_field(SourceParagraphFields::DESCRIPTION); + spgh->maintainer = parser.optional_field(SourceParagraphFields::MAINTAINER); + spgh->depends = expand_qualified_dependencies( + parse_comma_list(parser.optional_field(SourceParagraphFields::BUILD_DEPENDS))); + spgh->supports = parse_comma_list(parser.optional_field(SourceParagraphFields::SUPPORTS)); + spgh->default_features = parse_comma_list(parser.optional_field(SourceParagraphFields::DEFAULTFEATURES)); auto err = parser.error_info(spgh->name); if (err) @@ -114,10 +115,11 @@ namespace vcpkg auto fpgh = std::make_unique(); - parser.required_field(Fields::FEATURE, fpgh->name); - parser.required_field(Fields::DESCRIPTION, fpgh->description); + parser.required_field(SourceParagraphFields::FEATURE, fpgh->name); + parser.required_field(SourceParagraphFields::DESCRIPTION, fpgh->description); - fpgh->depends = expand_qualified_dependencies(parse_comma_list(parser.optional_field(Fields::BUILD_DEPENDS))); + fpgh->depends = expand_qualified_dependencies( + parse_comma_list(parser.optional_field(SourceParagraphFields::BUILD_DEPENDS))); auto err = parser.error_info(fpgh->name); if (err) diff --git a/toolsrc/src/StatusParagraph.cpp b/toolsrc/src/vcpkg/statusparagraph.cpp similarity index 98% rename from toolsrc/src/StatusParagraph.cpp rename to toolsrc/src/vcpkg/statusparagraph.cpp index f8ae293c24..5f00825e1b 100644 --- a/toolsrc/src/StatusParagraph.cpp +++ b/toolsrc/src/vcpkg/statusparagraph.cpp @@ -1,6 +1,6 @@ #include "pch.h" -#include "StatusParagraph.h" +#include using namespace vcpkg::Parse; diff --git a/toolsrc/src/StatusParagraphs.cpp b/toolsrc/src/vcpkg/statusparagraphs.cpp similarity index 97% rename from toolsrc/src/StatusParagraphs.cpp rename to toolsrc/src/vcpkg/statusparagraphs.cpp index aaba95eb90..647ed6d3f7 100644 --- a/toolsrc/src/StatusParagraphs.cpp +++ b/toolsrc/src/vcpkg/statusparagraphs.cpp @@ -1,8 +1,7 @@ #include "pch.h" -#include "StatusParagraphs.h" -#include "vcpkg_Checks.h" -#include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/triplet.cpp b/toolsrc/src/vcpkg/triplet.cpp similarity index 95% rename from toolsrc/src/triplet.cpp rename to toolsrc/src/vcpkg/triplet.cpp index 3b56da02a3..8a84ee2b2e 100644 --- a/toolsrc/src/triplet.cpp +++ b/toolsrc/src/vcpkg/triplet.cpp @@ -1,8 +1,8 @@ #include "pch.h" -#include "Triplet.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Strings.h" +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/commands_update.cpp b/toolsrc/src/vcpkg/update.cpp similarity index 93% rename from toolsrc/src/commands_update.cpp rename to toolsrc/src/vcpkg/update.cpp index 71ea4b0636..168949bc1b 100644 --- a/toolsrc/src/commands_update.cpp +++ b/toolsrc/src/vcpkg/update.cpp @@ -1,11 +1,13 @@ #include "pch.h" -#include "Paragraphs.h" -#include "vcpkg_Commands.h" -#include "vcpkg_System.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include -namespace vcpkg::Commands::Update +namespace vcpkg::Update { bool OutdatedPackage::compare_by_name(const OutdatedPackage& left, const OutdatedPackage& right) { diff --git a/toolsrc/src/VcpkgCmdArguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp similarity index 97% rename from toolsrc/src/VcpkgCmdArguments.cpp rename to toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index cb261930e6..5229616936 100644 --- a/toolsrc/src/VcpkgCmdArguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -1,10 +1,11 @@ #include "pch.h" -#include "VcpkgCmdArguments.h" -#include "metrics.h" -#include "vcpkg_Commands.h" -#include "vcpkg_GlobalState.h" -#include "vcpkg_System.h" +#include +#include +#include +#include +#include +#include namespace vcpkg { @@ -17,7 +18,7 @@ namespace vcpkg { System::println(System::Color::error, "Error: expected value after %s", option_name); Metrics::g_metrics.lock()->track_property("error", "error option name"); - Commands::Help::print_usage(); + Help::print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -25,7 +26,7 @@ namespace vcpkg { System::println(System::Color::error, "Error: %s specified multiple times", option_name); Metrics::g_metrics.lock()->track_property("error", "error option specified multiple times"); - Commands::Help::print_usage(); + Help::print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } @@ -38,7 +39,7 @@ namespace vcpkg { System::println(System::Color::error, "Error: conflicting values specified for --%s", option_name); Metrics::g_metrics.lock()->track_property("error", "error conflicting switches"); - Commands::Help::print_usage(); + Help::print_usage(); Checks::exit_fail(VCPKG_LINE_INFO); } option_field = new_setting; diff --git a/toolsrc/src/vcpkglib.cpp b/toolsrc/src/vcpkg/vcpkglib.cpp similarity index 98% rename from toolsrc/src/vcpkglib.cpp rename to toolsrc/src/vcpkg/vcpkglib.cpp index 5cdafdbc87..23c774210d 100644 --- a/toolsrc/src/vcpkglib.cpp +++ b/toolsrc/src/vcpkg/vcpkglib.cpp @@ -1,11 +1,11 @@ #include "pch.h" -#include "Paragraphs.h" -#include "metrics.h" -#include "vcpkg_Files.h" -#include "vcpkg_Strings.h" -#include "vcpkg_Util.h" -#include "vcpkglib.h" +#include +#include +#include +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/VcpkgPaths.cpp b/toolsrc/src/vcpkg/vcpkgpaths.cpp similarity index 99% rename from toolsrc/src/VcpkgPaths.cpp rename to toolsrc/src/vcpkg/vcpkgpaths.cpp index dac9e40e7b..07ce5c9617 100644 --- a/toolsrc/src/VcpkgPaths.cpp +++ b/toolsrc/src/vcpkg/vcpkgpaths.cpp @@ -1,12 +1,12 @@ #include "pch.h" -#include "PackageSpec.h" -#include "VcpkgPaths.h" -#include "metrics.h" -#include "vcpkg_Files.h" -#include "vcpkg_System.h" -#include "vcpkg_Util.h" -#include "vcpkg_expected.h" +#include +#include +#include +#include +#include +#include +#include namespace vcpkg { diff --git a/toolsrc/src/VersionT.cpp b/toolsrc/src/vcpkg/versiont.cpp similarity index 92% rename from toolsrc/src/VersionT.cpp rename to toolsrc/src/vcpkg/versiont.cpp index 738d2ce88c..1c52d674a5 100644 --- a/toolsrc/src/VersionT.cpp +++ b/toolsrc/src/vcpkg/versiont.cpp @@ -1,7 +1,7 @@ #include "pch.h" -#include "VersionT.h" -#include "vcpkg_Strings.h" +#include +#include namespace vcpkg { diff --git a/toolsrc/src/vcpkg_Build_BuildPolicy.cpp b/toolsrc/src/vcpkg_Build_BuildPolicy.cpp deleted file mode 100644 index b3bb778dce..0000000000 --- a/toolsrc/src/vcpkg_Build_BuildPolicy.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "pch.h" - -#include "vcpkg_Build.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Enums.h" - -namespace vcpkg::Build -{ - static const std::string NAME_EMPTY_PACKAGE = "PolicyEmptyPackage"; - static const std::string NAME_DLLS_WITHOUT_LIBS = "PolicyDLLsWithoutLIBs"; - static const std::string NAME_ONLY_RELEASE_CRT = "PolicyOnlyReleaseCRT"; - static const std::string NAME_EMPTY_INCLUDE_FOLDER = "PolicyEmptyIncludeFolder"; - static const std::string NAME_ALLOW_OBSOLETE_MSVCRT = "PolicyAllowObsoleteMsvcrt"; - - const std::string& to_string(BuildPolicy policy) - { - switch (policy) - { - case BuildPolicy::EMPTY_PACKAGE: return NAME_EMPTY_PACKAGE; - case BuildPolicy::DLLS_WITHOUT_LIBS: return NAME_DLLS_WITHOUT_LIBS; - case BuildPolicy::ONLY_RELEASE_CRT: return NAME_ONLY_RELEASE_CRT; - case BuildPolicy::EMPTY_INCLUDE_FOLDER: return NAME_EMPTY_INCLUDE_FOLDER; - case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return NAME_ALLOW_OBSOLETE_MSVCRT; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } - - CStringView to_cmake_variable(BuildPolicy policy) - { - switch (policy) - { - case BuildPolicy::EMPTY_PACKAGE: return "VCPKG_POLICY_EMPTY_PACKAGE"; - case BuildPolicy::DLLS_WITHOUT_LIBS: return "VCPKG_POLICY_DLLS_WITHOUT_LIBS"; - case BuildPolicy::ONLY_RELEASE_CRT: return "VCPKG_POLICY_ONLY_RELEASE_CRT"; - case BuildPolicy::EMPTY_INCLUDE_FOLDER: return "VCPKG_POLICY_EMPTY_INCLUDE_FOLDER"; - case BuildPolicy::ALLOW_OBSOLETE_MSVCRT: return "VCPKG_POLICY_ALLOW_OBSOLETE_MSVCRT"; - default: Checks::unreachable(VCPKG_LINE_INFO); - } - } -} diff --git a/toolsrc/src/vcpkg_metrics_uploader.cpp b/toolsrc/src/vcpkgmetricsuploader.cpp similarity index 85% rename from toolsrc/src/vcpkg_metrics_uploader.cpp rename to toolsrc/src/vcpkgmetricsuploader.cpp index cef4f4756b..2239fe7506 100644 --- a/toolsrc/src/vcpkg_metrics_uploader.cpp +++ b/toolsrc/src/vcpkgmetricsuploader.cpp @@ -1,6 +1,8 @@ -#include "metrics.h" -#include "vcpkg_Checks.h" -#include "vcpkg_Files.h" +#include + +#include +#include + #include using namespace vcpkg; diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj index 3bb945e857..ae332e0156 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj @@ -136,114 +136,114 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create Create Create Create - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters index 918f83b0a5..e902bffbbf 100644 --- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters +++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters @@ -13,312 +13,324 @@ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {69f6b6e6-5ac4-4419-a256-b8a6b0392720} + + + {4a229410-0d09-4dab-953b-f434d6483f96} + + + {75592043-ab63-4905-beee-568a6ab8bf93} + + + {fa1f10e7-58d2-4f7c-ac26-a979baa70061} + - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - Source Files - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg - - Source Files + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base + + + Source Files\vcpkg\base - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - Header Files - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg\base - - Header Files + + Header Files\vcpkg - - Header Files + + Header Files\vcpkg - - Header Files + + Header Files\vcpkg - - Header Files + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg + + + Header Files\vcpkg \ No newline at end of file diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj index 472d74e309..4b59c5ace2 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj @@ -131,7 +131,7 @@ - + diff --git a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters index a50df72501..8479210008 100644 --- a/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters +++ b/toolsrc/vcpkgmetricsuploader/vcpkgmetricsuploader.vcxproj.filters @@ -15,7 +15,7 @@ - + Source Files diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj b/toolsrc/vcpkgtest/vcpkgtest.vcxproj index 041e74d31b..d257481249 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj @@ -19,11 +19,11 @@ - - - - - + + + + + diff --git a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters index b31dbd9516..42691c614f 100644 --- a/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters +++ b/toolsrc/vcpkgtest/vcpkgtest.vcxproj.filters @@ -15,19 +15,19 @@ - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files