aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
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
parent8d955c83b53d42983ebd9a046a0a0a5ade08537f (diff)
parentbca0988023a8c7bfc896d0f5787eb02e74c6fb59 (diff)
downloadvcpkg-34c08e2b15777c86c5aaacfee5f04eed986c62da.tar.gz
vcpkg-34c08e2b15777c86c5aaacfee5f04eed986c62da.zip
Merge branch 'feature_package_implementation'
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/PackageSpec.h6
-rw-r--r--toolsrc/include/Paragraphs.h8
-rw-r--r--toolsrc/include/SourceParagraph.h27
-rw-r--r--toolsrc/include/vcpkg_Commands.h2
-rw-r--r--toolsrc/include/vcpkg_Input.h3
-rw-r--r--toolsrc/include/vcpkg_Strings.h2
6 files changed, 38 insertions, 10 deletions
diff --git a/toolsrc/include/PackageSpec.h b/toolsrc/include/PackageSpec.h
index 58edb8274..62b6fc9de 100644
--- a/toolsrc/include/PackageSpec.h
+++ b/toolsrc/include/PackageSpec.h
@@ -26,6 +26,12 @@ namespace vcpkg
Triplet m_triplet;
};
+ struct FullPackageSpec
+ {
+ PackageSpec package_spec;
+ std::vector<std::string> features;
+ };
+
bool operator==(const PackageSpec& left, const PackageSpec& right);
bool operator!=(const PackageSpec& left, const PackageSpec& right);
}
diff --git a/toolsrc/include/Paragraphs.h b/toolsrc/include/Paragraphs.h
index 04f9fb879..83a32b2af 100644
--- a/toolsrc/include/Paragraphs.h
+++ b/toolsrc/include/Paragraphs.h
@@ -16,20 +16,20 @@ namespace vcpkg::Paragraphs
Expected<ParagraphDataMap> parse_single_paragraph(const std::string& str);
Expected<std::vector<ParagraphDataMap>> parse_paragraphs(const std::string& str);
- ExpectedT<SourceParagraph, ParseControlErrorInfo> try_load_port(const Files::Filesystem& fs,
- const fs::path& control_path);
+ ExpectedT<SourceControlFile, ParseControlErrorInfo> try_load_port(const Files::Filesystem& fs,
+ const fs::path& control_path);
Expected<BinaryParagraph> try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec);
struct LoadResults
{
- std::vector<SourceParagraph> paragraphs;
+ std::vector<SourceControlFile> paragraphs;
std::vector<ParseControlErrorInfo> errors;
};
LoadResults try_load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir);
- std::vector<SourceParagraph> load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir);
+ std::vector<SourceControlFile> load_all_ports(const Files::Filesystem& fs, const fs::path& ports_dir);
std::map<std::string, VersionT> extract_port_names_and_versions(
const std::vector<SourceParagraph>& source_paragraphs);
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)
diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h
index 006971e47..67319f240 100644
--- a/toolsrc/include/vcpkg_Commands.h
+++ b/toolsrc/include/vcpkg_Commands.h
@@ -18,7 +18,7 @@ namespace vcpkg::Commands
namespace BuildCommand
{
- void perform_and_exit(const PackageSpec& spec,
+ void perform_and_exit(const FullPackageSpec& full_spec,
const fs::path& port_dir,
const std::unordered_set<std::string>& options,
const VcpkgPaths& paths);
diff --git a/toolsrc/include/vcpkg_Input.h b/toolsrc/include/vcpkg_Input.h
index 77f7ecfb5..fa568207a 100644
--- a/toolsrc/include/vcpkg_Input.h
+++ b/toolsrc/include/vcpkg_Input.h
@@ -6,6 +6,9 @@ namespace vcpkg::Input
PackageSpec check_and_get_package_spec(const std::string& package_spec_as_string,
const Triplet& default_triplet,
CStringView example_text);
+ FullPackageSpec check_and_get_full_package_spec(const std::string& full_package_spec_as_string,
+ const Triplet& default_triplet,
+ CStringView example_text);
void check_triplet(const Triplet& t, const VcpkgPaths& paths);
}
diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h
index e95a0601a..325a2cb4c 100644
--- a/toolsrc/include/vcpkg_Strings.h
+++ b/toolsrc/include/vcpkg_Strings.h
@@ -54,6 +54,8 @@ namespace vcpkg::Strings
std::string::const_iterator case_insensitive_ascii_find(const std::string& s, const std::string& pattern);
+ bool case_insensitive_ascii_contains(const std::string& s, const std::string& pattern);
+
int case_insensitive_ascii_compare(const CStringView left, const CStringView right);
std::string ascii_to_lowercase(const std::string& input);