diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2020-02-11 18:41:03 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2020-02-11 18:41:03 -0800 |
| commit | b9942d07441934c40869b16184455a7fef2024f5 (patch) | |
| tree | a29087f5728ab6b4929e65cc38c8a37d7b3ceb20 /toolsrc/include | |
| parent | acdbfaec173b4c2ab78dd592b6baf35cc3305839 (diff) | |
| download | vcpkg-b9942d07441934c40869b16184455a7fef2024f5.tar.gz vcpkg-b9942d07441934c40869b16184455a7fef2024f5.zip | |
[vcpkg] Extract binary caching functionality into separate interface
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg/binarycaching.h | 43 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg/build.h | 7 |
2 files changed, 49 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg/binarycaching.h b/toolsrc/include/vcpkg/binarycaching.h new file mode 100644 index 000000000..ff2be6eac --- /dev/null +++ b/toolsrc/include/vcpkg/binarycaching.h @@ -0,0 +1,43 @@ +#pragma once
+
+#include <vcpkg/base/files.h>
+#include <vcpkg/packagespec.h>
+#include <vcpkg/vcpkgpaths.h>
+
+namespace vcpkg::Dependencies
+{
+ struct InstallPlanAction;
+}
+namespace vcpkg::Build
+{
+ struct AbiTagAndFile;
+ struct BuildPackageOptions;
+}
+
+namespace vcpkg
+{
+ enum RestoreResult
+ {
+ MISSING,
+ SUCCESS,
+ BUILD_FAILED,
+ };
+
+ struct IBinaryProvider
+ {
+ virtual ~IBinaryProvider() = default;
+ virtual void prefetch() = 0;
+ virtual RestoreResult try_restore(const VcpkgPaths& paths,
+ const PackageSpec& spec,
+ const Build::AbiTagAndFile& abi_tag_and_file,
+ const Build::BuildPackageOptions& build_options) = 0;
+ virtual void push_success(const VcpkgPaths& paths,
+ const Build::AbiTagAndFile& abi_tag_and_file,
+ const Dependencies::InstallPlanAction& action) = 0;
+ virtual void push_failure(const VcpkgPaths& paths,
+ const Build::AbiTagAndFile& abi_tag_and_file,
+ const PackageSpec& spec) = 0;
+ };
+
+ std::unique_ptr<IBinaryProvider> create_archives_provider();
+}
diff --git a/toolsrc/include/vcpkg/build.h b/toolsrc/include/vcpkg/build.h index 67505d8f2..58a807776 100644 --- a/toolsrc/include/vcpkg/build.h +++ b/toolsrc/include/vcpkg/build.h @@ -16,6 +16,11 @@ #include <set> #include <vector> +namespace vcpkg +{ + struct IBinaryProvider; +} + namespace vcpkg::Dependencies { struct InstallPlanAction; @@ -28,7 +33,6 @@ namespace vcpkg::Build void perform_and_exit_ex(const FullPackageSpec& full_spec, const SourceControlFileLocation& scfl, const PortFileProvider::PathsPortFileProvider& provider, - const ParsedArguments& options, const VcpkgPaths& paths); void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths, Triplet default_triplet); @@ -202,6 +206,7 @@ namespace vcpkg::Build ExtendedBuildResult build_package(const VcpkgPaths& paths, const Dependencies::InstallPlanAction& config, const CMakeVars::CMakeVarProvider& var_provider, + IBinaryProvider* binaries_provider, const StatusParagraphs& status_db); enum class BuildPolicy |
