aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorJonathan Hale <Squareys@googlemail.com>2018-02-15 01:18:25 +0100
committerRobert Schumacher <roschuma@microsoft.com>2018-02-14 16:18:25 -0800
commit425d07ef7f82541e50cc8cb1e2716fc33bba7b12 (patch)
treee73f3675b5fe95f0dc61521a2a7457a6e5c08d53 /toolsrc/include
parent50a545fcff4b3c922aa3ef5d0646dc9850f1bb86 (diff)
downloadvcpkg-425d07ef7f82541e50cc8cb1e2716fc33bba7b12.tar.gz
vcpkg-425d07ef7f82541e50cc8cb1e2716fc33bba7b12.zip
[vcpkg] Implement Default-Features (#2697)
* [vcpkg] Add Default-Feature to make_status_pgh utility function Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Parse "Default-Features" as dependencies and add test for parsing Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Document some methods and structures Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Add install_default_features_test Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Change install_default_features_test to not have preinstalled package * [vcpkg] Test install behaviour of default features Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Implement default features Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Test default features upgrade behavior Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Implement upgrade with default features Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Test behaviour of upgrade with default features in dependencies Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Make upgrade install new default features Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Move collecting of packages for which to prevent defaults Further down the line to create_feature_install_plan. Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Fix core missing from default features and potential inf loop Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Rename, fix and move some tests Signed-off-by: Squareys <squareys@googlemail.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/tests.utils.h1
-rw-r--r--toolsrc/include/vcpkg/dependencies.h3
-rw-r--r--toolsrc/include/vcpkg/packagespec.h23
-rw-r--r--toolsrc/include/vcpkg/sourceparagraph.h9
-rw-r--r--toolsrc/include/vcpkg/statusparagraphs.h5
5 files changed, 39 insertions, 2 deletions
diff --git a/toolsrc/include/tests.utils.h b/toolsrc/include/tests.utils.h
index b23abe4eb..970506663 100644
--- a/toolsrc/include/tests.utils.h
+++ b/toolsrc/include/tests.utils.h
@@ -20,6 +20,7 @@ namespace Microsoft::VisualStudio::CppUnitTestFramework
std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,
const char* depends = "",
+ const char* default_features = "",
const char* triplet = "x86-windows");
std::unique_ptr<vcpkg::StatusParagraph> make_status_feature_pgh(const char* name,
const char* feature,
diff --git a/toolsrc/include/vcpkg/dependencies.h b/toolsrc/include/vcpkg/dependencies.h
index 014f004a2..4abeb678e 100644
--- a/toolsrc/include/vcpkg/dependencies.h
+++ b/toolsrc/include/vcpkg/dependencies.h
@@ -151,7 +151,8 @@ namespace vcpkg::Dependencies
PackageGraph(const PortFileProvider& provider, const StatusParagraphs& status_db);
~PackageGraph();
- void install(const FeatureSpec& spec) const;
+ void install(const FeatureSpec& spec,
+ const std::unordered_set<std::string>& prevent_default_features = {}) const;
void upgrade(const PackageSpec& spec) const;
std::vector<AnyAction> serialize() const;
diff --git a/toolsrc/include/vcpkg/packagespec.h b/toolsrc/include/vcpkg/packagespec.h
index f1119e2f3..0a4347639 100644
--- a/toolsrc/include/vcpkg/packagespec.h
+++ b/toolsrc/include/vcpkg/packagespec.h
@@ -15,6 +15,12 @@ namespace vcpkg
static ExpectedT<ParsedSpecifier, PackageSpecParseResult> from_string(const std::string& input);
};
+ ///
+ /// <summary>
+ /// Full specification of a package. Contains all information to reference
+ /// a specific package.
+ /// </summary>
+ ///
struct PackageSpec
{
static ExpectedT<PackageSpec, PackageSpecParseResult> from_name_and_triplet(const std::string& name,
@@ -46,6 +52,12 @@ namespace vcpkg
Triplet m_triplet;
};
+ ///
+ /// <summary>
+ /// Full specification of a feature. Contains all information to reference
+ /// a single feature in a specific package.
+ /// </summary>
+ ///
struct FeatureSpec
{
FeatureSpec(const PackageSpec& spec, const std::string& feature) : m_spec(spec), m_feature(feature) {}
@@ -82,6 +94,12 @@ namespace vcpkg
std::string m_feature;
};
+ ///
+ /// <summary>
+ /// Full specification of a package. Contains all information to reference
+ /// a collection of features in a single package.
+ /// </summary>
+ ///
struct FullPackageSpec
{
PackageSpec package_spec;
@@ -93,6 +111,11 @@ namespace vcpkg
const Triplet& default_triplet);
};
+ ///
+ /// <summary>
+ /// Contains all information to reference a collection of features in a single package by their names.
+ /// </summary>
+ ///
struct Features
{
std::string name;
diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h
index dcbbc1c3b..ea8e27a94 100644
--- a/toolsrc/include/vcpkg/sourceparagraph.h
+++ b/toolsrc/include/vcpkg/sourceparagraph.h
@@ -29,6 +29,9 @@ namespace vcpkg
std::string to_string(const Dependency& dep);
+ /// <summary>
+ /// Port metadata of additional feature in a package (part of CONTROL file)
+ /// </summary>
struct FeatureParagraph
{
std::string name;
@@ -37,7 +40,7 @@ namespace vcpkg
};
/// <summary>
- /// Port metadata (CONTROL file)
+ /// Port metadata of the core feature of a package (part of CONTROL file)
/// </summary>
struct SourceParagraph
{
@@ -49,6 +52,10 @@ namespace vcpkg
std::vector<Dependency> depends;
std::vector<std::string> default_features;
};
+
+ /// <summary>
+ /// Full metadata of a package: core and other features.
+ /// </summary>
struct SourceControlFile
{
static Parse::ParseExpected<SourceControlFile> parse_control_file(
diff --git a/toolsrc/include/vcpkg/statusparagraphs.h b/toolsrc/include/vcpkg/statusparagraphs.h
index fd33f8094..b3eec266a 100644
--- a/toolsrc/include/vcpkg/statusparagraphs.h
+++ b/toolsrc/include/vcpkg/statusparagraphs.h
@@ -6,6 +6,11 @@
namespace vcpkg
{
+ /// <summary>Status paragraphs</summary>
+ ///
+ /// Collection of <see cref="vcpkg::StatusParagraph"/>, e.g. contains the information
+ /// about whether a package is installed or not.
+ ///
struct StatusParagraphs
{
StatusParagraphs();