[M1] add manifest::write

This commit is contained in:
2026-05-08 10:50:38 +00:00
parent 95a8890623
commit b0c54b8f5a
6 changed files with 250 additions and 0 deletions

View File

@@ -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