[M1] add manifest::parse
This commit is contained in:
@@ -1,3 +1,37 @@
|
||||
export module cargoxx.manifest;
|
||||
|
||||
import std;
|
||||
import cargoxx.util;
|
||||
|
||||
export namespace cargoxx::manifest {
|
||||
|
||||
struct Dependency {
|
||||
std::string name;
|
||||
std::string version_spec;
|
||||
std::vector<std::string> components;
|
||||
};
|
||||
|
||||
struct BuildSettings {
|
||||
bool warnings_as_errors = false;
|
||||
std::vector<std::string> sanitizers;
|
||||
};
|
||||
|
||||
enum class Edition { Cpp20, Cpp23, Cpp26 };
|
||||
|
||||
struct Package {
|
||||
std::string name;
|
||||
std::string version;
|
||||
Edition edition = Edition::Cpp23;
|
||||
std::vector<std::string> authors;
|
||||
std::optional<std::string> license;
|
||||
};
|
||||
|
||||
struct Manifest {
|
||||
Package package;
|
||||
std::vector<Dependency> dependencies;
|
||||
BuildSettings build;
|
||||
};
|
||||
|
||||
auto parse(const std::filesystem::path& path) -> util::Result<Manifest>;
|
||||
|
||||
} // namespace cargoxx::manifest
|
||||
|
||||
Reference in New Issue
Block a user