diff options
| author | Daniel Shaw <t-dansha@microsoft.com> | 2017-07-19 14:29:28 -0700 |
|---|---|---|
| committer | Daniel Shaw <t-dansha@microsoft.com> | 2017-07-24 15:21:32 -0700 |
| commit | 59389ca236b005922cf1101f66c957d2396f6371 (patch) | |
| tree | 42bbcc25b501967203c63dd55b665ec9f49a41e4 /toolsrc/include | |
| parent | 1445115906139f5c6d14bcbbacdcc0cfb543fd80 (diff) | |
| download | vcpkg-59389ca236b005922cf1101f66c957d2396f6371.tar.gz vcpkg-59389ca236b005922cf1101f66c957d2396f6371.zip | |
end to end feature pkg draft
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/BinaryParagraph.h | 3 | ||||
| -rw-r--r-- | toolsrc/include/PackageSpec.h | 6 | ||||
| -rw-r--r-- | toolsrc/include/SourceParagraph.h | 1 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Build.h | 23 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Commands.h | 1 | ||||
| -rw-r--r-- | toolsrc/include/vcpkg_Dependencies.h | 34 |
6 files changed, 54 insertions, 14 deletions
diff --git a/toolsrc/include/BinaryParagraph.h b/toolsrc/include/BinaryParagraph.h index 4adde5e36..f411b3c39 100644 --- a/toolsrc/include/BinaryParagraph.h +++ b/toolsrc/include/BinaryParagraph.h @@ -14,6 +14,9 @@ namespace vcpkg BinaryParagraph(); explicit BinaryParagraph(std::unordered_map<std::string, std::string> fields); BinaryParagraph(const SourceParagraph& spgh, const Triplet& triplet); + BinaryParagraph::BinaryParagraph(const SourceParagraph& spgh, + const FeatureParagraph& fpgh, + const Triplet& triplet); std::string displayname() const; diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h index 62b6fc9de..15b5e5b9b 100644 --- a/toolsrc/include/PackageSpec.h +++ b/toolsrc/include/PackageSpec.h @@ -1,5 +1,6 @@ #pragma once #include "PackageSpecParseResult.h" +#include "SourceParagraph.h" #include "Triplet.h" #include "vcpkg_expected.h" @@ -7,8 +8,6 @@ namespace vcpkg { struct PackageSpec { - static ExpectedT<PackageSpec, PackageSpecParseResult> from_string(const std::string& spec_as_string, - const Triplet& default_triplet); static std::string to_string(const std::string& name, const Triplet& triplet); static ExpectedT<PackageSpec, PackageSpecParseResult> from_name_and_triplet(const std::string& name, const Triplet& triplet); @@ -30,6 +29,9 @@ namespace vcpkg { PackageSpec package_spec; std::vector<std::string> features; + + static ExpectedT<FullPackageSpec, PackageSpecParseResult> from_string(const std::string& spec_as_string, + const Triplet& default_triplet); }; bool operator==(const PackageSpec& left, const PackageSpec& right); diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h index e85884b51..7ddf999cc 100644 --- a/toolsrc/include/SourceParagraph.h +++ b/toolsrc/include/SourceParagraph.h @@ -60,6 +60,7 @@ namespace vcpkg std::vector<std::string> filter_dependencies(const std::vector<Dependency>& deps, const Triplet& t); + // zlib[uwp] becomes Dependency{"zlib", "uwp"} std::vector<Dependency> expand_qualified_dependencies(const std::vector<std::string>& depends); std::vector<std::string> parse_comma_list(const std::string& str); diff --git a/toolsrc/include/vcpkg_Build.h b/toolsrc/include/vcpkg_Build.h index 9a4e2baeb..c4f3e6746 100644 --- a/toolsrc/include/vcpkg_Build.h +++ b/toolsrc/include/vcpkg_Build.h @@ -95,14 +95,35 @@ namespace vcpkg::Build const Triplet& triplet, fs::path&& port_dir, const BuildPackageOptions& build_package_options) - : src(src), triplet(triplet), port_dir(std::move(port_dir)), build_package_options(build_package_options) + : src(src) + , scf(nullptr) + , triplet(triplet) + , port_dir(std::move(port_dir)) + , build_package_options(build_package_options) + , feature_list(nullptr) + { + } + + BuildPackageConfig(const SourceControlFile& src, + const Triplet& triplet, + fs::path&& port_dir, + const BuildPackageOptions& build_package_options, + const std::unordered_set<std::string>& feature_list) + : src(*src.core_paragraph) + , scf(&src) + , triplet(triplet) + , port_dir(std::move(port_dir)) + , build_package_options(build_package_options) + , feature_list(&feature_list) { } const SourceParagraph& src; + const SourceControlFile* scf; const Triplet& triplet; fs::path port_dir; const BuildPackageOptions& build_package_options; + const std::unordered_set<std::string>* feature_list; }; ExtendedBuildResult build_package(const VcpkgPaths& paths, diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h index 67319f240..8348a64e4 100644 --- a/toolsrc/include/vcpkg_Commands.h +++ b/toolsrc/include/vcpkg_Commands.h @@ -77,6 +77,7 @@ namespace vcpkg::Commands namespace Remove { 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 diff --git a/toolsrc/include/vcpkg_Dependencies.h b/toolsrc/include/vcpkg_Dependencies.h index ff559c0f1..e3af0fd28 100644 --- a/toolsrc/include/vcpkg_Dependencies.h +++ b/toolsrc/include/vcpkg_Dependencies.h @@ -26,12 +26,6 @@ namespace vcpkg::Dependencies Optional<SourceParagraph> source_paragraph; Optional<const SourceControlFile*> source_control_file; }; - - struct ClusterNode - { - std::vector<StatusParagraph> status_paragraphs; - Optional<const SourceControlFile*> source_paragraph; - }; } namespace vcpkg::Dependencies @@ -48,11 +42,13 @@ namespace vcpkg::Dependencies std::vector<FeatureSpec> build_edges; bool plus = false; }; - std::vector<FeatureSpec> to_feature_specs(const std::vector<std::string> depends, - const std::unordered_map<std::string, PackageSpec> str_to_spec); + std::vector<FeatureSpec> to_feature_specs(const std::vector<std::string>& depends, const Triplet& t); + struct Cluster { - ClusterNode cluster_data; + std::vector<StatusParagraph> status_paragraphs; + Optional<const SourceControlFile*> source_control_file; + PackageSpec spec; std::unordered_map<std::string, FeatureNodeEdges> edges; std::unordered_set<std::string> to_install_features; std::unordered_set<std::string> original_features; @@ -65,6 +61,13 @@ namespace vcpkg::Dependencies Cluster& operator=(const Cluster&) = delete; }; + struct ClusterPtr + { + Cluster* ptr; + }; + + bool operator==(const ClusterPtr& l, const ClusterPtr& r); + enum class InstallPlanType { UNKNOWN, @@ -181,12 +184,21 @@ namespace vcpkg::Dependencies const StatusParagraphs& status_db); } +template<> +struct std::hash<vcpkg::Dependencies::ClusterPtr> +{ + size_t operator()(const vcpkg::Dependencies::ClusterPtr& value) const + { + return std::hash<vcpkg::PackageSpec>()(value.ptr->spec); + } +}; + namespace vcpkg::Dependencies { struct GraphPlan { - Graphs::Graph<Cluster*> remove_graph; - Graphs::Graph<Cluster*> install_graph; + Graphs::Graph<ClusterPtr> remove_graph; + Graphs::Graph<ClusterPtr> install_graph; }; bool mark_plus(const std::string& feature, Cluster& cluster, |
