2017-10-13 18:37:41 -07:00
|
|
|
#pragma once
|
|
|
|
|
2017-11-29 23:45:47 -08:00
|
|
|
#include <vcpkg/base/chrono.h>
|
2017-10-13 18:37:41 -07:00
|
|
|
#include <vcpkg/build.h>
|
|
|
|
#include <vcpkg/dependencies.h>
|
|
|
|
#include <vcpkg/vcpkgcmdarguments.h>
|
|
|
|
#include <vcpkg/vcpkgpaths.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace vcpkg::Install
|
|
|
|
{
|
|
|
|
enum class KeepGoing
|
|
|
|
{
|
|
|
|
NO = 0,
|
|
|
|
YES
|
|
|
|
};
|
|
|
|
|
|
|
|
inline KeepGoing to_keep_going(const bool value) { return value ? KeepGoing::YES : KeepGoing::NO; }
|
|
|
|
|
2017-10-18 19:04:14 -07:00
|
|
|
struct SpecSummary
|
2017-10-13 18:37:41 -07:00
|
|
|
{
|
2020-02-03 14:22:52 -08:00
|
|
|
SpecSummary(const PackageSpec& spec, const Dependencies::InstallPlanAction* action);
|
2017-11-16 17:42:15 -08:00
|
|
|
|
|
|
|
const BinaryParagraph* get_binary_paragraph() const;
|
2017-10-18 19:04:14 -07:00
|
|
|
|
|
|
|
PackageSpec spec;
|
2017-11-16 19:29:32 -08:00
|
|
|
Build::ExtendedBuildResult build_result;
|
2017-11-29 23:45:47 -08:00
|
|
|
vcpkg::Chrono::ElapsedTime timing;
|
2017-11-16 17:42:15 -08:00
|
|
|
|
2020-02-03 14:22:52 -08:00
|
|
|
const Dependencies::InstallPlanAction* action;
|
2017-10-13 18:37:41 -07:00
|
|
|
};
|
|
|
|
|
2017-10-18 19:04:14 -07:00
|
|
|
struct InstallSummary
|
|
|
|
{
|
|
|
|
std::vector<SpecSummary> results;
|
|
|
|
std::string total_elapsed_time;
|
|
|
|
|
|
|
|
void print() const;
|
2017-11-29 23:45:47 -08:00
|
|
|
std::string xunit_results() const;
|
2017-10-18 19:04:14 -07:00
|
|
|
};
|
2017-10-13 18:37:41 -07:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2017-11-16 19:29:32 -08:00
|
|
|
Build::ExtendedBuildResult perform_install_plan_action(const VcpkgPaths& paths,
|
2020-02-03 14:22:52 -08:00
|
|
|
Dependencies::InstallPlanAction& action,
|
|
|
|
StatusParagraphs& status_db,
|
|
|
|
const CMakeVars::CMakeVarProvider& var_provider);
|
2017-10-13 18:37:41 -07:00
|
|
|
|
|
|
|
enum class InstallResult
|
|
|
|
{
|
|
|
|
FILE_CONFLICTS,
|
|
|
|
SUCCESS,
|
|
|
|
};
|
|
|
|
|
2017-10-26 19:00:30 -07:00
|
|
|
std::vector<std::string> get_all_port_names(const VcpkgPaths& paths);
|
|
|
|
|
2020-06-17 12:32:05 -07:00
|
|
|
void install_package_and_write_listfile(const VcpkgPaths& paths, const PackageSpec& spec, const InstallDir& dirs);
|
|
|
|
|
|
|
|
void install_files_and_write_listfile(Files::Filesystem& fs,
|
|
|
|
const fs::path& source_dir,
|
|
|
|
const std::vector<fs::path>& files,
|
|
|
|
const InstallDir& destination_dir);
|
|
|
|
|
2017-10-13 18:37:41 -07:00
|
|
|
InstallResult install_package(const VcpkgPaths& paths,
|
|
|
|
const BinaryControlFile& binary_paragraph,
|
|
|
|
StatusParagraphs* status_db);
|
|
|
|
|
2020-02-03 14:22:52 -08:00
|
|
|
InstallSummary perform(Dependencies::ActionPlan& action_plan,
|
2017-10-18 19:04:14 -07:00
|
|
|
const KeepGoing keep_going,
|
|
|
|
const VcpkgPaths& paths,
|
2020-02-03 14:22:52 -08:00
|
|
|
StatusParagraphs& status_db,
|
2020-04-29 10:16:40 -07:00
|
|
|
IBinaryProvider& binaryprovider,
|
2020-02-03 14:22:52 -08:00
|
|
|
const CMakeVars::CMakeVarProvider& var_provider);
|
2017-10-13 18:37:41 -07:00
|
|
|
|
2017-10-14 02:16:55 -07:00
|
|
|
extern const CommandStructure COMMAND_STRUCTURE;
|
2017-10-13 20:58:00 -07:00
|
|
|
|
2020-02-07 11:24:35 -08:00
|
|
|
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet);
|
2017-10-13 18:37:41 -07:00
|
|
|
}
|