export module cargoxx.manifest; import std; import cargoxx.util; export namespace cargoxx::manifest { enum class DepSource { Auto, // string form or { version = ... } only → existing resolver chain CargoxxPath, // { path = "../foo" } → recursive cargoxx build CargoxxGit, // { git = "...", rev = "..." } → fetch + recursive cargoxx build }; struct Dependency { std::string name; std::string version_spec; std::vector components; DepSource source = DepSource::Auto; std::optional path; // when source == CargoxxPath std::optional git_url; // when source == CargoxxGit std::optional git_rev; // when source == CargoxxGit (40-char) bool operator==(const Dependency&) const = default; }; struct BuildSettings { bool warnings_as_errors = false; std::vector sanitizers; std::vector include_dirs; bool operator==(const BuildSettings&) const = default; }; enum class Edition { Cpp20, Cpp23, Cpp26 }; struct Package { std::string name; std::string version; Edition edition = Edition::Cpp23; std::vector authors; std::optional license; bool operator==(const Package&) const = default; }; struct Manifest { Package package; std::vector dependencies; std::vector dev_dependencies; BuildSettings build; bool operator==(const Manifest&) const = default; }; auto parse(const std::filesystem::path& path) -> util::Result; auto write(const Manifest& m, const std::filesystem::path& path) -> util::Result; } // namespace cargoxx::manifest