1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-12 20:11:03 +01:00

No templates for Buildable and BuildableReq

This commit is contained in:
John Ericson 2021-04-05 09:15:25 -04:00
parent 255d145ba7
commit 4fe41c6db3
2 changed files with 17 additions and 16 deletions

View file

@ -20,31 +20,35 @@ struct BuildableOpaque {
static BuildableOpaque parse(const Store & store, std::string_view);
};
template<typename Outputs>
struct BuildableForFromDrv {
struct BuildableReqFromDrv {
StorePath drvPath;
Outputs outputs;
std::set<std::string> outputs;
nlohmann::json toJSON(ref<Store> store) const;
std::string to_string(const Store & store) const;
static BuildableForFromDrv<Outputs> parse(const Store & store, std::string_view);
static BuildableReqFromDrv parse(const Store & store, std::string_view);
};
template <typename Outputs>
using BuildableFor = std::variant<
using BuildableReq = std::variant<
BuildableOpaque,
BuildableForFromDrv<Outputs>
BuildableReqFromDrv
>;
typedef BuildableForFromDrv<std::set<std::string>> BuildableReqFromDrv;
typedef BuildableFor<std::set<std::string>> BuildableReq;
std::string to_string(const Store & store, const BuildableReq &);
BuildableReq parseBuildableReq(const Store & store, std::string_view);
typedef BuildableForFromDrv<std::map<std::string, std::optional<StorePath>>> BuildableFromDrv;
typedef BuildableFor<std::map<std::string, std::optional<StorePath>>> Buildable;
struct BuildableFromDrv {
StorePath drvPath;
std::map<std::string, std::optional<StorePath>> outputs;
nlohmann::json toJSON(ref<Store> store) const;
static BuildableFromDrv parse(const Store & store, std::string_view);
};
using Buildable = std::variant<
BuildableOpaque,
BuildableFromDrv
>;
typedef std::vector<Buildable> Buildables;