mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 19:25:27 +08:00
vcpkg_paths -> VcpkgPaths
This commit is contained in:
parent
402552ef93
commit
3f76b9e53d
@ -4,7 +4,7 @@
|
||||
#include <map>
|
||||
#include "vcpkg_expected.h"
|
||||
#include "BinaryParagraph.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "VersionT.h"
|
||||
|
||||
namespace vcpkg::Paragraphs
|
||||
@ -18,7 +18,7 @@ namespace vcpkg::Paragraphs
|
||||
|
||||
Expected<SourceParagraph> try_load_port(const fs::path& control_path);
|
||||
|
||||
Expected<BinaryParagraph> try_load_cached_package(const vcpkg_paths& paths, const PackageSpec& spec);
|
||||
Expected<BinaryParagraph> try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec);
|
||||
|
||||
std::vector<SourceParagraph> load_all_ports(const fs::path& ports_dir);
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include "PackageSpec.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
|
||||
namespace vcpkg::PostBuildLint
|
||||
{
|
||||
size_t perform_all_checks(const PackageSpec& spec, const vcpkg_paths& paths);
|
||||
size_t perform_all_checks(const PackageSpec& spec, const VcpkgPaths& paths);
|
||||
}
|
||||
|
@ -14,9 +14,9 @@ namespace vcpkg
|
||||
CWStringView version;
|
||||
};
|
||||
|
||||
struct vcpkg_paths
|
||||
struct VcpkgPaths
|
||||
{
|
||||
static Expected<vcpkg_paths> create(const fs::path& vcpkg_root_dir);
|
||||
static Expected<VcpkgPaths> create(const fs::path& vcpkg_root_dir);
|
||||
|
||||
fs::path package_dir(const PackageSpec& spec) const;
|
||||
fs::path port_dir(const PackageSpec& spec) const;
|
@ -1,15 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "VcpkgCmdArguments.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "StatusParagraphs.h"
|
||||
#include <array>
|
||||
#include "VersionT.h"
|
||||
|
||||
namespace vcpkg::Commands
|
||||
{
|
||||
using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
using CommandTypeB = void(*)(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
using CommandTypeA = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
using CommandTypeB = void(*)(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
using CommandTypeC = void(*)(const VcpkgCmdArguments& args);
|
||||
|
||||
namespace Build
|
||||
@ -31,30 +31,30 @@ namespace vcpkg::Commands
|
||||
|
||||
std::wstring make_build_env_cmd(const Triplet& target_triplet, const Toolset& toolset);
|
||||
|
||||
BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db);
|
||||
void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set<std::string>& options, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const VcpkgPaths& paths, const fs::path& port_dir, const StatusParagraphs& status_db);
|
||||
void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set<std::string>& options, const VcpkgPaths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
}
|
||||
|
||||
namespace BuildExternal
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
}
|
||||
|
||||
namespace Install
|
||||
{
|
||||
void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
void install_package(const VcpkgPaths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
}
|
||||
|
||||
namespace CI
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
}
|
||||
|
||||
namespace Remove
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet);
|
||||
}
|
||||
|
||||
namespace Update
|
||||
@ -67,67 +67,67 @@ namespace vcpkg::Commands
|
||||
VersionDiff version_diff;
|
||||
};
|
||||
|
||||
std::vector<OutdatedPackage> find_outdated_packages(const vcpkg_paths& paths, const StatusParagraphs& status_db);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
std::vector<OutdatedPackage> find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Env
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_triplet);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet);
|
||||
}
|
||||
|
||||
namespace Create
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Edit
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Search
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace List
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Owns
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Cache
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Import
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Integrate
|
||||
{
|
||||
extern const char*const INTEGRATE_COMMAND_HELPSTRING;
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace PortsDiff
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
}
|
||||
|
||||
namespace Help
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths);
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
|
||||
|
||||
void help_topic_valid_triplet(const vcpkg_paths& paths);
|
||||
void help_topic_valid_triplet(const VcpkgPaths& paths);
|
||||
|
||||
void print_usage();
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
#include <vector>
|
||||
#include "PackageSpec.h"
|
||||
#include "StatusParagraphs.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "vcpkg_optional.h"
|
||||
|
||||
namespace vcpkg::Dependencies
|
||||
@ -73,7 +73,7 @@ namespace vcpkg::Dependencies
|
||||
RemovePlanAction plan;
|
||||
};
|
||||
|
||||
std::vector<PackageSpecWithInstallPlan> create_install_plan(const vcpkg_paths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
|
||||
std::vector<PackageSpecWithInstallPlan> create_install_plan(const VcpkgPaths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
|
||||
|
||||
std::vector<PackageSpecWithRemovePlan> create_remove_plan(const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "PackageSpec.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
|
||||
namespace vcpkg::Input
|
||||
{
|
||||
@ -10,5 +10,5 @@ namespace vcpkg::Input
|
||||
const Triplet& default_target_triplet,
|
||||
CStringView example_text);
|
||||
|
||||
void check_triplet(const Triplet& t, const vcpkg_paths& paths);
|
||||
void check_triplet(const Triplet& t, const VcpkgPaths& paths);
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "StatusParagraphs.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "SortedVector.h"
|
||||
|
||||
namespace vcpkg
|
||||
{
|
||||
extern bool g_debugging;
|
||||
|
||||
StatusParagraphs database_load_check(const vcpkg_paths& paths);
|
||||
StatusParagraphs database_load_check(const VcpkgPaths& paths);
|
||||
|
||||
void write_update(const vcpkg_paths& paths, const StatusParagraph& p);
|
||||
void write_update(const VcpkgPaths& paths, const StatusParagraph& p);
|
||||
|
||||
struct StatusParagraph_and_associated_files
|
||||
{
|
||||
@ -19,7 +19,7 @@ namespace vcpkg
|
||||
};
|
||||
|
||||
std::vector<StatusParagraph*> get_installed_ports(const StatusParagraphs& status_db);
|
||||
std::vector<StatusParagraph_and_associated_files> get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db);
|
||||
std::vector<StatusParagraph_and_associated_files> get_installed_files(const VcpkgPaths& paths, const StatusParagraphs& status_db);
|
||||
|
||||
|
||||
struct CMakeVariable
|
||||
|
@ -222,7 +222,7 @@ namespace vcpkg::Paragraphs
|
||||
return pghs.error_code();
|
||||
}
|
||||
|
||||
Expected<BinaryParagraph> try_load_cached_package(const vcpkg_paths& paths, const PackageSpec& spec)
|
||||
Expected<BinaryParagraph> try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec)
|
||||
{
|
||||
Expected<std::unordered_map<std::string, std::string>> pghs = get_single_paragraph(paths.package_dir(spec) / "CONTROL");
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "pch.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "PackageSpec.h"
|
||||
#include "vcpkg_Files.h"
|
||||
#include "vcpkg_System.h"
|
||||
@ -174,7 +174,7 @@ namespace vcpkg::PostBuildLint
|
||||
return lint_status::SUCCESS;
|
||||
}
|
||||
|
||||
static lint_status check_for_copyright_file(const PackageSpec& spec, const vcpkg_paths& paths)
|
||||
static lint_status check_for_copyright_file(const PackageSpec& spec, const VcpkgPaths& paths)
|
||||
{
|
||||
const fs::path packages_dir = paths.packages / spec.dir();
|
||||
const fs::path copyright_file = packages_dir / "share" / spec.name() / "copyright";
|
||||
@ -619,7 +619,7 @@ namespace vcpkg::PostBuildLint
|
||||
left += static_cast<size_t>(right);
|
||||
}
|
||||
|
||||
static size_t perform_all_checks_and_return_error_count(const PackageSpec& spec, const vcpkg_paths& paths)
|
||||
static size_t perform_all_checks_and_return_error_count(const PackageSpec& spec, const VcpkgPaths& paths)
|
||||
{
|
||||
// for dumpbin
|
||||
const Toolset& toolset = paths.get_toolset();
|
||||
@ -709,7 +709,7 @@ namespace vcpkg::PostBuildLint
|
||||
return error_count;
|
||||
}
|
||||
|
||||
size_t perform_all_checks(const PackageSpec& spec, const vcpkg_paths& paths)
|
||||
size_t perform_all_checks(const PackageSpec& spec, const VcpkgPaths& paths)
|
||||
{
|
||||
System::println("-- Performing post-build validation");
|
||||
const size_t error_count = perform_all_checks_and_return_error_count(spec, paths);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "vcpkg_expected.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "metrics.h"
|
||||
#include "vcpkg_System.h"
|
||||
#include "PackageSpec.h"
|
||||
@ -152,7 +152,7 @@ namespace vcpkg
|
||||
return fetch_dependency(scripts_folder, L"git", downloaded_copy);
|
||||
}
|
||||
|
||||
Expected<vcpkg_paths> vcpkg_paths::create(const fs::path& vcpkg_root_dir)
|
||||
Expected<VcpkgPaths> VcpkgPaths::create(const fs::path& vcpkg_root_dir)
|
||||
{
|
||||
std::error_code ec;
|
||||
const fs::path canonical_vcpkg_root_dir = fs::canonical(vcpkg_root_dir, ec);
|
||||
@ -161,7 +161,7 @@ namespace vcpkg
|
||||
return ec;
|
||||
}
|
||||
|
||||
vcpkg_paths paths;
|
||||
VcpkgPaths paths;
|
||||
paths.root = canonical_vcpkg_root_dir;
|
||||
|
||||
if (paths.root.empty())
|
||||
@ -191,27 +191,27 @@ namespace vcpkg
|
||||
return paths;
|
||||
}
|
||||
|
||||
fs::path vcpkg_paths::package_dir(const PackageSpec& spec) const
|
||||
fs::path VcpkgPaths::package_dir(const PackageSpec& spec) const
|
||||
{
|
||||
return this->packages / spec.dir();
|
||||
}
|
||||
|
||||
fs::path vcpkg_paths::port_dir(const PackageSpec& spec) const
|
||||
fs::path VcpkgPaths::port_dir(const PackageSpec& spec) const
|
||||
{
|
||||
return this->ports / spec.name();
|
||||
}
|
||||
|
||||
fs::path vcpkg_paths::build_info_file_path(const PackageSpec& spec) const
|
||||
fs::path VcpkgPaths::build_info_file_path(const PackageSpec& spec) const
|
||||
{
|
||||
return this->package_dir(spec) / "BUILD_INFO";
|
||||
}
|
||||
|
||||
fs::path vcpkg_paths::listfile_path(const BinaryParagraph& pgh) const
|
||||
fs::path VcpkgPaths::listfile_path(const BinaryParagraph& pgh) const
|
||||
{
|
||||
return this->vcpkg_dir_info / (pgh.fullstem() + ".list");
|
||||
}
|
||||
|
||||
bool vcpkg_paths::is_valid_triplet(const Triplet& t) const
|
||||
bool VcpkgPaths::is_valid_triplet(const Triplet& t) const
|
||||
{
|
||||
auto it = fs::directory_iterator(this->triplets);
|
||||
for (; it != fs::directory_iterator(); ++it)
|
||||
@ -226,22 +226,22 @@ namespace vcpkg
|
||||
return false;
|
||||
}
|
||||
|
||||
const fs::path& vcpkg_paths::get_cmake_exe() const
|
||||
const fs::path& VcpkgPaths::get_cmake_exe() const
|
||||
{
|
||||
return this->cmake_exe.get_lazy([this]() { return get_cmake_path(this->downloads, this->scripts); });
|
||||
}
|
||||
|
||||
const fs::path& vcpkg_paths::get_git_exe() const
|
||||
const fs::path& VcpkgPaths::get_git_exe() const
|
||||
{
|
||||
return this->git_exe.get_lazy([this]() { return get_git_path(this->downloads, this->scripts); });
|
||||
}
|
||||
|
||||
const fs::path& vcpkg_paths::get_nuget_exe() const
|
||||
const fs::path& VcpkgPaths::get_nuget_exe() const
|
||||
{
|
||||
return this->nuget_exe.get_lazy([this]() { return get_nuget_path(this->downloads, this->scripts); });
|
||||
}
|
||||
|
||||
static std::vector<std::string> get_VS2017_installation_instances(const vcpkg_paths& paths)
|
||||
static std::vector<std::string> get_VS2017_installation_instances(const VcpkgPaths& paths)
|
||||
{
|
||||
const fs::path script = paths.scripts / "findVisualStudioInstallationInstances.ps1";
|
||||
const std::wstring cmd = System::create_powershell_script_cmd(script);
|
||||
@ -262,7 +262,7 @@ namespace vcpkg
|
||||
return nullopt;
|
||||
}
|
||||
|
||||
static Toolset find_toolset_instance(const vcpkg_paths& paths)
|
||||
static Toolset find_toolset_instance(const VcpkgPaths& paths)
|
||||
{
|
||||
const std::vector<std::string> vs2017_installation_instances = get_VS2017_installation_instances(paths);
|
||||
// Note: this will contain a mix of vcvarsall.bat locations and dumpbin.exe locations.
|
||||
@ -331,7 +331,7 @@ namespace vcpkg
|
||||
Checks::exit_fail(VCPKG_LINE_INFO);
|
||||
}
|
||||
|
||||
const Toolset& vcpkg_paths::get_toolset() const
|
||||
const Toolset& VcpkgPaths::get_toolset() const
|
||||
{
|
||||
return this->toolset.get_lazy([this]() { return find_toolset_instance(*this); });
|
||||
}
|
@ -18,7 +18,7 @@ namespace vcpkg::Commands::Build
|
||||
|
||||
static const std::string OPTION_CHECKS_ONLY = "--checks-only";
|
||||
|
||||
static void create_binary_control_file(const vcpkg_paths& paths, const SourceParagraph& source_paragraph, const Triplet& target_triplet)
|
||||
static void create_binary_control_file(const VcpkgPaths& paths, const SourceParagraph& source_paragraph, const Triplet& target_triplet)
|
||||
{
|
||||
const BinaryParagraph bpgh = BinaryParagraph(source_paragraph, target_triplet);
|
||||
const fs::path binary_control_file = paths.packages / bpgh.dir() / "CONTROL";
|
||||
@ -32,7 +32,7 @@ namespace vcpkg::Commands::Build
|
||||
Strings::utf8_to_utf16(target_triplet.architecture()));
|
||||
}
|
||||
|
||||
BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const vcpkg_paths& paths, const fs::path& port_dir, const StatusParagraphs& status_db)
|
||||
BuildResult build_package(const SourceParagraph& source_paragraph, const PackageSpec& spec, const VcpkgPaths& paths, const fs::path& port_dir, const StatusParagraphs& status_db)
|
||||
{
|
||||
Checks::check_exit(VCPKG_LINE_INFO, spec.name() == source_paragraph.name, "inconsistent arguments to build_package()");
|
||||
|
||||
@ -127,7 +127,7 @@ namespace vcpkg::Commands::Build
|
||||
, spec.toString(), Version::version());
|
||||
}
|
||||
|
||||
void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set<std::string>& options, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const PackageSpec& spec, const fs::path& port_dir, const std::unordered_set<std::string>& options, const VcpkgPaths& paths)
|
||||
{
|
||||
if (options.find(OPTION_CHECKS_ONLY) != options.end())
|
||||
{
|
||||
@ -174,7 +174,7 @@ namespace vcpkg::Commands::Build
|
||||
Checks::exit_success(VCPKG_LINE_INFO);
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string("build zlib:x64-windows");
|
||||
args.check_exact_arg_count(1, example); // Build only takes a single package and all dependencies must already be installed
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace vcpkg::Commands::BuildExternal
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)");
|
||||
args.check_exact_arg_count(2, example);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Cache
|
||||
{
|
||||
static std::vector<BinaryParagraph> read_all_binary_paragraphs(const vcpkg_paths& paths)
|
||||
static std::vector<BinaryParagraph> read_all_binary_paragraphs(const VcpkgPaths& paths)
|
||||
{
|
||||
std::vector<BinaryParagraph> output;
|
||||
for (auto it = fs::directory_iterator(paths.packages); it != fs::directory_iterator(); ++it)
|
||||
@ -24,7 +24,7 @@ namespace vcpkg::Commands::Cache
|
||||
return output;
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
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"));
|
||||
|
@ -26,7 +26,7 @@ namespace vcpkg::Commands::CI
|
||||
return specs;
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string("ci x64-windows");
|
||||
args.check_max_arg_count(1, example);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Create
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string(R"###(create zlib2 http://zlib.net/zlib1211.zip "zlib1211-2.zip")###");
|
||||
args.check_max_arg_count(3, example);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Edit
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string("edit zlib");
|
||||
args.check_exact_arg_count(1, example);
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Env
|
||||
{
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_triplet)
|
||||
{
|
||||
static const std::string example = Commands::Help::create_example_string(R"(env --Triplet x64-windows)");
|
||||
args.check_exact_arg_count(0, example);
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Help
|
||||
{
|
||||
void help_topic_valid_triplet(const vcpkg_paths& paths)
|
||||
void help_topic_valid_triplet(const VcpkgPaths& paths)
|
||||
{
|
||||
System::println("Available architecture triplets:");
|
||||
auto it = fs::directory_iterator(paths.triplets);
|
||||
@ -64,7 +64,7 @@ namespace vcpkg::Commands::Help
|
||||
System::println(create_example_string(command_and_arguments));
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
args.check_max_arg_count(1);
|
||||
args.check_and_get_optional_command_arguments({});
|
||||
|
@ -58,7 +58,7 @@ namespace vcpkg::Commands::Import
|
||||
copy_files_into_directory(debug_binaries.libs, destination_path / "debug" / "lib");
|
||||
}
|
||||
|
||||
static void do_import(const vcpkg_paths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data)
|
||||
static void do_import(const VcpkgPaths& paths, const fs::path& include_directory, const fs::path& project_directory, const BinaryParagraph& control_file_data)
|
||||
{
|
||||
fs::path library_destination_path = paths.package_dir(control_file_data.spec);
|
||||
fs::create_directory(library_destination_path);
|
||||
@ -68,7 +68,7 @@ namespace vcpkg::Commands::Import
|
||||
std::ofstream(control_file_path) << control_file_data;
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
static const std::string example = Commands::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);
|
||||
|
@ -14,7 +14,7 @@ namespace vcpkg::Commands::Install
|
||||
using Dependencies::PackageSpecWithInstallPlan;
|
||||
using Dependencies::InstallPlanType;
|
||||
|
||||
static void install_and_write_listfile(const vcpkg_paths& paths, const BinaryParagraph& bpgh)
|
||||
static void install_and_write_listfile(const VcpkgPaths& paths, const BinaryParagraph& bpgh)
|
||||
{
|
||||
std::vector<std::string> output;
|
||||
|
||||
@ -136,7 +136,7 @@ namespace vcpkg::Commands::Install
|
||||
return SortedVector<std::string>(std::move(installed_files));
|
||||
}
|
||||
|
||||
void install_package(const vcpkg_paths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db)
|
||||
void install_package(const VcpkgPaths& paths, const BinaryParagraph& binary_paragraph, StatusParagraphs* status_db)
|
||||
{
|
||||
const fs::path package_dir = paths.package_dir(binary_paragraph.spec);
|
||||
const Triplet& triplet = binary_paragraph.spec.target_triplet();
|
||||
@ -183,7 +183,7 @@ namespace vcpkg::Commands::Install
|
||||
status_db->insert(std::make_unique<StatusParagraph>(spgh));
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
|
||||
{
|
||||
// input sanitization
|
||||
static const std::string example = Commands::Help::create_example_string("install zlib zlib:x64-windows curl boost");
|
||||
|
@ -139,7 +139,7 @@ namespace vcpkg::Commands::Integrate
|
||||
return local_app_data / "vcpkg" / "vcpkg.user.targets";
|
||||
}
|
||||
|
||||
static void integrate_install(const vcpkg_paths& paths)
|
||||
static void integrate_install(const VcpkgPaths& paths)
|
||||
{
|
||||
// TODO: This block of code should eventually be removed
|
||||
for (auto&& old_system_wide_targets_file : old_system_target_files)
|
||||
@ -243,7 +243,7 @@ namespace vcpkg::Commands::Integrate
|
||||
Checks::exit_success(VCPKG_LINE_INFO);
|
||||
}
|
||||
|
||||
static void integrate_project(const vcpkg_paths& paths)
|
||||
static void integrate_project(const VcpkgPaths& paths)
|
||||
{
|
||||
const fs::path& nuget_exe = paths.get_nuget_exe();
|
||||
|
||||
@ -284,7 +284,7 @@ With a project open, go to Tools->NuGet Package Manager->Package Manager Console
|
||||
" vcpkg integrate remove Remove user-wide integration\n"
|
||||
" vcpkg integrate project Generate a referencing nuget package for individual VS project use\n";
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
static const std::string example = Strings::format("Commands:\n"
|
||||
"%s", INTEGRATE_COMMAND_HELPSTRING);
|
||||
|
@ -14,7 +14,7 @@ namespace vcpkg::Commands::List
|
||||
details::shorten_description(pgh.package.description));
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
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"));
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
namespace vcpkg::Commands::Owns
|
||||
{
|
||||
static void search_file(const vcpkg_paths& paths, const std::string& file_substr, const StatusParagraphs& status_db)
|
||||
static void search_file(const VcpkgPaths& paths, const std::string& file_substr, const StatusParagraphs& status_db)
|
||||
{
|
||||
const std::vector<StatusParagraph_and_associated_files> installed_files = get_installed_files(paths, status_db);
|
||||
for (const StatusParagraph_and_associated_files& pgh_and_file : installed_files)
|
||||
@ -22,7 +22,7 @@ namespace vcpkg::Commands::Owns
|
||||
}
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
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"));
|
||||
args.check_exact_arg_count(1, example);
|
||||
|
@ -67,7 +67,7 @@ namespace vcpkg::Commands::PortsDiff
|
||||
}
|
||||
}
|
||||
|
||||
static std::map<std::string, VersionT> read_ports_from_commit(const vcpkg_paths& paths, const std::wstring& git_commit_id)
|
||||
static std::map<std::string, VersionT> read_ports_from_commit(const VcpkgPaths& paths, const std::wstring& git_commit_id)
|
||||
{
|
||||
const fs::path& git_exe = paths.get_git_exe();
|
||||
const fs::path dot_git_dir = paths.root / ".git";
|
||||
@ -100,7 +100,7 @@ namespace vcpkg::Commands::PortsDiff
|
||||
Checks::check_exit(VCPKG_LINE_INFO, output.output == VALID_COMMIT_OUTPUT, "Invalid commit id %s", Strings::utf16_to_utf8(git_commit_id));
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
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"));
|
||||
args.check_min_arg_count(1, example);
|
||||
|
@ -27,7 +27,7 @@ namespace vcpkg::Commands::Remove
|
||||
}
|
||||
}
|
||||
|
||||
static void remove_package(const vcpkg_paths& paths, const PackageSpec& spec, StatusParagraphs* status_db)
|
||||
static void remove_package(const VcpkgPaths& paths, const PackageSpec& spec, StatusParagraphs* status_db)
|
||||
{
|
||||
StatusParagraph& pkg = **status_db->find(spec.name(), spec.target_triplet());
|
||||
|
||||
@ -162,7 +162,7 @@ namespace vcpkg::Commands::Remove
|
||||
}
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths, const Triplet& default_target_triplet)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, const Triplet& default_target_triplet)
|
||||
{
|
||||
static const std::string OPTION_PURGE = "--purge";
|
||||
static const std::string OPTION_NO_PURGE = "--no-purge";
|
||||
|
@ -52,7 +52,7 @@ namespace vcpkg::Commands::Search
|
||||
details::shorten_description(source_paragraph.description));
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
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"));
|
||||
|
@ -12,7 +12,7 @@ namespace vcpkg::Commands::Update
|
||||
return left.spec.name() < right.spec.name();
|
||||
}
|
||||
|
||||
std::vector<OutdatedPackage> find_outdated_packages(const vcpkg_paths& paths, const StatusParagraphs& status_db)
|
||||
std::vector<OutdatedPackage> find_outdated_packages(const VcpkgPaths& paths, const StatusParagraphs& status_db)
|
||||
{
|
||||
const std::vector<SourceParagraph> source_paragraphs = Paragraphs::load_all_ports(paths.ports);
|
||||
const std::map<std::string, VersionT> src_names_to_versions = Paragraphs::extract_port_names_and_versions(source_paragraphs);
|
||||
@ -36,7 +36,7 @@ namespace vcpkg::Commands::Update
|
||||
return output;
|
||||
}
|
||||
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const vcpkg_paths& paths)
|
||||
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
|
||||
{
|
||||
args.check_exact_arg_count(0);
|
||||
args.check_and_get_optional_command_arguments({});
|
||||
|
@ -58,9 +58,9 @@ static void inner(const VcpkgCmdArguments& args)
|
||||
|
||||
Checks::check_exit(VCPKG_LINE_INFO, !vcpkg_root_dir.empty(), "Error: Could not detect vcpkg-root.");
|
||||
|
||||
const Expected<vcpkg_paths> expected_paths = vcpkg_paths::create(vcpkg_root_dir);
|
||||
const Expected<VcpkgPaths> expected_paths = VcpkgPaths::create(vcpkg_root_dir);
|
||||
Checks::check_exit(VCPKG_LINE_INFO, !expected_paths.error_code(), "Error: Invalid vcpkg root directory %s: %s", vcpkg_root_dir.string(), expected_paths.error_code().message());
|
||||
const vcpkg_paths paths = expected_paths.value_or_exit(VCPKG_LINE_INFO);
|
||||
const VcpkgPaths paths = expected_paths.value_or_exit(VCPKG_LINE_INFO);
|
||||
int exit_code = _wchdir(paths.root.c_str());
|
||||
Checks::check_exit(VCPKG_LINE_INFO, exit_code == 0, "Changing the working dir failed");
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "pch.h"
|
||||
#include "vcpkg_Dependencies.h"
|
||||
#include "vcpkg_Graphs.h"
|
||||
#include "vcpkg_paths.h"
|
||||
#include "VcpkgPaths.h"
|
||||
#include "PackageSpec.h"
|
||||
#include "StatusParagraphs.h"
|
||||
#include "vcpkg_Files.h"
|
||||
@ -35,7 +35,7 @@ namespace vcpkg::Dependencies
|
||||
{
|
||||
}
|
||||
|
||||
std::vector<PackageSpecWithInstallPlan> create_install_plan(const vcpkg_paths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db)
|
||||
std::vector<PackageSpecWithInstallPlan> create_install_plan(const VcpkgPaths& paths, const std::vector<PackageSpec>& specs, const StatusParagraphs& status_db)
|
||||
{
|
||||
std::unordered_map<PackageSpec, InstallPlanAction> was_examined; // Examine = we have checked its immediate (non-recursive) dependencies
|
||||
Graphs::Graph<PackageSpec> graph;
|
||||
|
@ -21,7 +21,7 @@ namespace vcpkg::Input
|
||||
Checks::exit_fail(VCPKG_LINE_INFO);
|
||||
}
|
||||
|
||||
void check_triplet(const Triplet& t, const vcpkg_paths& paths)
|
||||
void check_triplet(const Triplet& t, const VcpkgPaths& paths)
|
||||
{
|
||||
if (!paths.is_valid_triplet(t))
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ namespace vcpkg
|
||||
return StatusParagraphs(std::move(status_pghs));
|
||||
}
|
||||
|
||||
StatusParagraphs database_load_check(const vcpkg_paths& paths)
|
||||
StatusParagraphs database_load_check(const VcpkgPaths& paths)
|
||||
{
|
||||
auto updates_dir = paths.vcpkg_dir_updates;
|
||||
|
||||
@ -91,7 +91,7 @@ namespace vcpkg
|
||||
return current_status_db;
|
||||
}
|
||||
|
||||
void write_update(const vcpkg_paths& paths, const StatusParagraph& p)
|
||||
void write_update(const VcpkgPaths& paths, const StatusParagraph& p)
|
||||
{
|
||||
static int update_id = 0;
|
||||
auto my_update_id = update_id++;
|
||||
@ -184,7 +184,7 @@ namespace vcpkg
|
||||
return installed_packages;
|
||||
}
|
||||
|
||||
std::vector<StatusParagraph_and_associated_files> get_installed_files(const vcpkg_paths& paths, const StatusParagraphs& status_db)
|
||||
std::vector<StatusParagraph_and_associated_files> get_installed_files(const VcpkgPaths& paths, const StatusParagraphs& status_db)
|
||||
{
|
||||
std::vector<StatusParagraph_and_associated_files> installed_files;
|
||||
|
||||
|
@ -175,7 +175,7 @@
|
||||
<ClInclude Include="..\include\vcpkg_Input.h" />
|
||||
<ClInclude Include="..\include\vcpkg_Maps.h" />
|
||||
<ClInclude Include="..\include\vcpkg_optional.h" />
|
||||
<ClInclude Include="..\include\vcpkg_paths.h" />
|
||||
<ClInclude Include="..\include\VcpkgPaths.h" />
|
||||
<ClInclude Include="..\include\vcpkg_Strings.h" />
|
||||
<ClInclude Include="..\include\vcpkg_System.h" />
|
||||
<ClInclude Include="..\include\vcpkg_Util.h" />
|
||||
@ -239,7 +239,7 @@
|
||||
<ClCompile Include="..\src\vcpkg_Enums.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg_Files.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg_Input.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg_paths.cpp" />
|
||||
<ClCompile Include="..\src\VcpkgPaths.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg_Strings.cpp" />
|
||||
<ClCompile Include="..\src\vcpkg_System.cpp" />
|
||||
</ItemGroup>
|
||||
|
@ -33,9 +33,6 @@
|
||||
<ClCompile Include="..\src\vcpkglib_helpers.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\vcpkg_paths.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\Paragraphs.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
@ -180,6 +177,9 @@
|
||||
<ClCompile Include="..\include\VersionT.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\VcpkgPaths.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\SourceParagraph.h">
|
||||
@ -200,9 +200,6 @@
|
||||
<ClInclude Include="..\include\triplet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\vcpkg_paths.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\Paragraphs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
@ -314,5 +311,8 @@
|
||||
<ClInclude Include="..\include\VersionT.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\VcpkgPaths.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user