aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/SourceParagraph.h
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2017-06-19 15:09:54 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-06-19 15:09:54 -0700
commit34c08e2b15777c86c5aaacfee5f04eed986c62da (patch)
tree5a65eed065343bcb2f999da6937d423fff00c93e /toolsrc/include/SourceParagraph.h
parent8d955c83b53d42983ebd9a046a0a0a5ade08537f (diff)
parentbca0988023a8c7bfc896d0f5787eb02e74c6fb59 (diff)
downloadvcpkg-34c08e2b15777c86c5aaacfee5f04eed986c62da.tar.gz
vcpkg-34c08e2b15777c86c5aaacfee5f04eed986c62da.zip
Merge branch 'feature_package_implementation'
Diffstat (limited to 'toolsrc/include/SourceParagraph.h')
-rw-r--r--toolsrc/include/SourceParagraph.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/toolsrc/include/SourceParagraph.h b/toolsrc/include/SourceParagraph.h
index 2f30e338e..31c9560cc 100644
--- a/toolsrc/include/SourceParagraph.h
+++ b/toolsrc/include/SourceParagraph.h
@@ -10,6 +10,8 @@
namespace vcpkg
{
+ extern bool g_feature_packages;
+
struct Triplet;
struct Dependency
@@ -27,23 +29,38 @@ namespace vcpkg
std::error_code error;
};
+ struct FeatureParagraph
+ {
+ std::string name;
+ std::string description;
+ std::vector<Dependency> depends;
+ };
+
/// <summary>
/// Port metadata (CONTROL file)
/// </summary>
struct SourceParagraph
{
- static ExpectedT<SourceParagraph, ParseControlErrorInfo> parse_control_file(
- std::unordered_map<std::string, std::string> fields);
-
- SourceParagraph() = default;
-
std::string name;
std::string version;
std::string description;
std::string maintainer;
std::vector<std::string> supports;
std::vector<Dependency> depends;
+ std::string default_features;
};
+ struct SourceControlFile
+ {
+ static ExpectedT<SourceControlFile, ParseControlErrorInfo> parse_control_file(
+ std::vector<std::unordered_map<std::string, std::string>>&& control_paragraphs);
+
+ SourceParagraph core_paragraph;
+ std::vector<std::unique_ptr<FeatureParagraph>> feature_paragraphs;
+
+ std::vector<ParseControlErrorInfo> errors;
+ };
+
+ std::vector<SourceParagraph> getSourceParagraphs(const std::vector<SourceControlFile>& control_files);
void print_error_message(span<const ParseControlErrorInfo> error_info_list);
inline void print_error_message(const ParseControlErrorInfo& error_info_list)