aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorVictor Romero <romerosanchezv@gmail.com>2020-10-26 10:24:30 -0700
committerGitHub <noreply@github.com>2020-10-26 10:24:30 -0700
commite9f8cc67a5e5541973e53ac03f88adb45cc1b21b (patch)
treeb123780ce6a6d738a6bdb40e588eb4579c3074d9 /toolsrc/include
parentac2ddd5f059b56b6e0b9fc0c73bd4feccad539ff (diff)
downloadvcpkg-e9f8cc67a5e5541973e53ac03f88adb45cc1b21b.tar.gz
vcpkg-e9f8cc67a5e5541973e53ac03f88adb45cc1b21b.zip
[vcpkg] Implement versions db generator (#13777)
* [vcpkg] Add script to generate ports versions history * [vcpkg] Fix formatting * Fetch port versions from commit ID * Use global --x-json switch * Use --no-checkout when cloning secondary instance * Clone from local repository instead of from GitHub * Use CmdLineBuilder to build git commands * Use CmdLineBuilder and reduce repeated code * Fetch version at baseline and code cleanup * Guess version scheme from old CONTROL files * Rename version db generator script * Simplify x-history json output * Use CONTROL/manifest parsers on x-history * Use git-tree instaed of commit-id * Remove 'ports' field from root object * Clean up code * More code cleanup * Improve port version detection * Improve generator logging * Do not ignore parsing errors in CONTROL files * PR review comments in Python script * Fix subprocess.run() calls * Make `canonicalize()` return error instead of terminating * [vcpkg] Add tests for new test_parse_control_file paths * Remove unnecessary std::move() calls * Fix formatting * Python formatting Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/paragraphs.h6
-rw-r--r--toolsrc/include/vcpkg/sourceparagraph.h5
-rw-r--r--toolsrc/include/vcpkg/versions.h6
3 files changed, 12 insertions, 5 deletions
diff --git a/toolsrc/include/vcpkg/paragraphs.h b/toolsrc/include/vcpkg/paragraphs.h
index f4ea36ede..0293f0733 100644
--- a/toolsrc/include/vcpkg/paragraphs.h
+++ b/toolsrc/include/vcpkg/paragraphs.h
@@ -17,12 +17,18 @@ namespace vcpkg::Paragraphs
ExpectedS<Paragraph> parse_single_paragraph(const std::string& str, const std::string& origin);
ExpectedS<Paragraph> get_single_paragraph(const Files::Filesystem& fs, const fs::path& control_path);
+
ExpectedS<std::vector<Paragraph>> get_paragraphs(const Files::Filesystem& fs, const fs::path& control_path);
+ ExpectedS<std::vector<Paragraph>> get_paragraphs_text(const std::string& text, const std::string& origin);
+
ExpectedS<std::vector<Paragraph>> parse_paragraphs(const std::string& str, const std::string& origin);
bool is_port_directory(const Files::Filesystem& fs, const fs::path& path);
Parse::ParseExpected<SourceControlFile> try_load_port(const Files::Filesystem& fs, const fs::path& path);
+ Parse::ParseExpected<SourceControlFile> try_load_port_text(const std::string& text,
+ const std::string& origin,
+ bool is_manifest);
ExpectedS<BinaryControlFile> try_load_cached_package(const VcpkgPaths& paths, const PackageSpec& spec);
diff --git a/toolsrc/include/vcpkg/sourceparagraph.h b/toolsrc/include/vcpkg/sourceparagraph.h
index 21e5a4ef9..d88c0b0fd 100644
--- a/toolsrc/include/vcpkg/sourceparagraph.h
+++ b/toolsrc/include/vcpkg/sourceparagraph.h
@@ -91,11 +91,14 @@ namespace vcpkg
return ret;
}
+ static Parse::ParseExpected<SourceControlFile> parse_manifest_object(const std::string& origin,
+ const Json::Object& object);
+
static Parse::ParseExpected<SourceControlFile> parse_manifest_file(const fs::path& path_to_manifest,
const Json::Object& object);
static Parse::ParseExpected<SourceControlFile> parse_control_file(
- const fs::path& path_to_control, std::vector<Parse::Paragraph>&& control_paragraphs);
+ const std::string& origin, std::vector<Parse::Paragraph>&& control_paragraphs);
// Always non-null in non-error cases
std::unique_ptr<SourceParagraph> core_paragraph;
diff --git a/toolsrc/include/vcpkg/versions.h b/toolsrc/include/vcpkg/versions.h
index f0304c788..331bf7f8b 100644
--- a/toolsrc/include/vcpkg/versions.h
+++ b/toolsrc/include/vcpkg/versions.h
@@ -1,14 +1,12 @@
#pragma once
-#include <vcpkg/fwd/vcpkgpaths.h>
-
namespace vcpkg::Versions
{
enum class Scheme
{
- String,
Relaxed,
Semver,
- Date
+ Date,
+ String
};
}