2020-02-11 18:41:03 -08:00
|
|
|
#pragma once
|
|
|
|
|
2020-04-29 10:16:40 -07:00
|
|
|
#include <vcpkg/base/expected.h>
|
2020-02-11 18:41:03 -08:00
|
|
|
#include <vcpkg/base/files.h>
|
|
|
|
#include <vcpkg/packagespec.h>
|
|
|
|
#include <vcpkg/vcpkgpaths.h>
|
|
|
|
|
|
|
|
namespace vcpkg::Dependencies
|
|
|
|
{
|
|
|
|
struct InstallPlanAction;
|
2020-06-26 12:16:02 -07:00
|
|
|
struct ActionPlan;
|
2020-02-11 18:41:03 -08:00
|
|
|
}
|
|
|
|
namespace vcpkg::Build
|
|
|
|
{
|
|
|
|
struct AbiTagAndFile;
|
|
|
|
struct BuildPackageOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2020-03-18 11:19:25 -07:00
|
|
|
enum class RestoreResult
|
2020-02-11 18:41:03 -08:00
|
|
|
{
|
2020-03-18 11:19:25 -07:00
|
|
|
missing,
|
|
|
|
success,
|
|
|
|
build_failed,
|
2020-02-11 18:41:03 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IBinaryProvider
|
|
|
|
{
|
|
|
|
virtual ~IBinaryProvider() = default;
|
2020-06-26 12:16:02 -07:00
|
|
|
/// Gives the BinaryProvider an opportunity to batch any downloading or server communication for executing
|
|
|
|
/// `plan`.
|
|
|
|
virtual void prefetch(const VcpkgPaths& paths, const Dependencies::ActionPlan& plan) = 0;
|
|
|
|
/// Attempts to restore the package referenced by `action` into the packages directory.
|
2020-02-11 23:52:56 -08:00
|
|
|
virtual RestoreResult try_restore(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0;
|
2020-06-26 12:16:02 -07:00
|
|
|
/// Called upon a successful build of `action`
|
2020-02-11 23:52:56 -08:00
|
|
|
virtual void push_success(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& action) = 0;
|
2020-06-26 12:16:02 -07:00
|
|
|
/// Called upon a failure during the build of `action`
|
2020-02-11 23:52:56 -08:00
|
|
|
virtual void push_failure(const VcpkgPaths& paths, const std::string& abi_tag, const PackageSpec& spec) = 0;
|
2020-06-26 12:16:02 -07:00
|
|
|
/// Requests the result of `try_restore()` without actually downloading the package. Used by CI to determine
|
|
|
|
/// missing packages.
|
2020-02-11 23:52:56 -08:00
|
|
|
virtual RestoreResult precheck(const VcpkgPaths& paths,
|
2020-06-26 12:16:17 -07:00
|
|
|
const Dependencies::InstallPlanAction& action) = 0;
|
2020-02-11 18:41:03 -08:00
|
|
|
};
|
|
|
|
|
2020-06-22 14:14:36 -07:00
|
|
|
IBinaryProvider& null_binary_provider();
|
|
|
|
|
2020-04-29 10:16:40 -07:00
|
|
|
ExpectedS<std::unique_ptr<IBinaryProvider>> create_binary_provider_from_configs(const VcpkgPaths& paths,
|
|
|
|
View<std::string> args);
|
|
|
|
ExpectedS<std::unique_ptr<IBinaryProvider>> create_binary_provider_from_configs_pure(const std::string& env_string,
|
|
|
|
View<std::string> args);
|
2020-06-26 12:16:02 -07:00
|
|
|
|
|
|
|
void help_topic_binary_caching(const VcpkgPaths& paths);
|
2020-02-11 18:41:03 -08:00
|
|
|
}
|