[M1] add manifest::write
This commit is contained in:
@@ -9,11 +9,15 @@ struct Dependency {
|
||||
std::string name;
|
||||
std::string version_spec;
|
||||
std::vector<std::string> components;
|
||||
|
||||
bool operator==(const Dependency&) const = default;
|
||||
};
|
||||
|
||||
struct BuildSettings {
|
||||
bool warnings_as_errors = false;
|
||||
std::vector<std::string> sanitizers;
|
||||
|
||||
bool operator==(const BuildSettings&) const = default;
|
||||
};
|
||||
|
||||
enum class Edition { Cpp20, Cpp23, Cpp26 };
|
||||
@@ -24,14 +28,19 @@ struct Package {
|
||||
Edition edition = Edition::Cpp23;
|
||||
std::vector<std::string> authors;
|
||||
std::optional<std::string> license;
|
||||
|
||||
bool operator==(const Package&) const = default;
|
||||
};
|
||||
|
||||
struct Manifest {
|
||||
Package package;
|
||||
std::vector<Dependency> dependencies;
|
||||
BuildSettings build;
|
||||
|
||||
bool operator==(const Manifest&) const = default;
|
||||
};
|
||||
|
||||
auto parse(const std::filesystem::path& path) -> util::Result<Manifest>;
|
||||
auto write(const Manifest& m, const std::filesystem::path& path) -> util::Result<void>;
|
||||
|
||||
} // namespace cargoxx::manifest
|
||||
|
||||
Reference in New Issue
Block a user