mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-15 02:36:16 +02:00
Merge pull request #11639 from DeterminateSystems/avoid-json-header
experimental-features.hh: Don't include json-utils.hh
This commit is contained in:
commit
5e5c97962c
11 changed files with 25 additions and 12 deletions
|
@ -11,6 +11,8 @@
|
||||||
#include "value-to-json.hh"
|
#include "value-to-json.hh"
|
||||||
#include "fetch-to-store.hh"
|
#include "fetch-to-store.hh"
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
#include "git-utils.hh"
|
#include "git-utils.hh"
|
||||||
#include "logging.hh"
|
#include "logging.hh"
|
||||||
#include "finally.hh"
|
#include "finally.hh"
|
||||||
|
|
||||||
#include "fetch-settings.hh"
|
#include "fetch-settings.hh"
|
||||||
|
#include "json-utils.hh"
|
||||||
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
#include "value-to-json.hh"
|
#include "value-to-json.hh"
|
||||||
#include "local-fs-store.hh"
|
#include "local-fs-store.hh"
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
using namespace flake;
|
using namespace flake;
|
||||||
|
|
|
@ -7,11 +7,12 @@
|
||||||
#include "split.hh"
|
#include "split.hh"
|
||||||
#include "common-protocol.hh"
|
#include "common-protocol.hh"
|
||||||
#include "common-protocol-impl.hh"
|
#include "common-protocol-impl.hh"
|
||||||
|
#include "strings-inline.hh"
|
||||||
|
#include "json-utils.hh"
|
||||||
|
|
||||||
#include <boost/container/small_vector.hpp>
|
#include <boost/container/small_vector.hpp>
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include "strings-inline.hh"
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
std::optional<StorePath> DerivationOutput::path(const StoreDirConfig & store, std::string_view drvName, OutputNameView outputName) const
|
std::optional<StorePath> DerivationOutput::path(const StoreDirConfig & store, std::string_view drvName, OutputNameView outputName) const
|
||||||
|
|
|
@ -50,6 +50,8 @@
|
||||||
|
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include "strings.hh"
|
#include "strings.hh"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "nar-info.hh"
|
#include "nar-info.hh"
|
||||||
#include "store-api.hh"
|
#include "store-api.hh"
|
||||||
#include "strings.hh"
|
#include "strings.hh"
|
||||||
|
#include "json-utils.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "config-global.hh"
|
#include "config-global.hh"
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
bool GlobalConfig::set(const std::string & name, const std::string & value)
|
bool GlobalConfig::set(const std::string & name, const std::string & value)
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
///@file
|
///@file
|
||||||
|
|
||||||
#include "error.hh"
|
#include "error.hh"
|
||||||
#include "json-utils.hh"
|
|
||||||
#include "types.hh"
|
#include "types.hh"
|
||||||
|
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -98,10 +99,4 @@ public:
|
||||||
void to_json(nlohmann::json &, const ExperimentalFeature &);
|
void to_json(nlohmann::json &, const ExperimentalFeature &);
|
||||||
void from_json(const nlohmann::json &, ExperimentalFeature &);
|
void from_json(const nlohmann::json &, ExperimentalFeature &);
|
||||||
|
|
||||||
/**
|
|
||||||
* It is always rendered as a string
|
|
||||||
*/
|
|
||||||
template<>
|
|
||||||
struct json_avoids_null<ExperimentalFeature> : std::true_type {};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,13 @@
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <nlohmann/json_fwd.hpp>
|
|
||||||
|
|
||||||
#include "types.hh"
|
#include "types.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
enum struct ExperimentalFeature;
|
||||||
|
|
||||||
const nlohmann::json * get(const nlohmann::json & map, const std::string & key);
|
const nlohmann::json * get(const nlohmann::json & map, const std::string & key);
|
||||||
|
|
||||||
nlohmann::json * get(nlohmann::json & map, const std::string & key);
|
nlohmann::json * get(nlohmann::json & map, const std::string & key);
|
||||||
|
@ -71,6 +72,12 @@ struct json_avoids_null<std::list<T>> : std::true_type {};
|
||||||
template<typename K, typename V>
|
template<typename K, typename V>
|
||||||
struct json_avoids_null<std::map<K, V>> : std::true_type {};
|
struct json_avoids_null<std::map<K, V>> : std::true_type {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `ExperimentalFeature` is always rendered as a string.
|
||||||
|
*/
|
||||||
|
template<>
|
||||||
|
struct json_avoids_null<ExperimentalFeature> : std::true_type {};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace nlohmann {
|
namespace nlohmann {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "eval-cache.hh"
|
#include "eval-cache.hh"
|
||||||
#include "flake/flake.hh"
|
#include "flake/flake.hh"
|
||||||
#include "self-exe.hh"
|
#include "self-exe.hh"
|
||||||
|
#include "json-utils.hh"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
#include <nlohmann/json.hpp>
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
|
@ -9,6 +8,7 @@
|
||||||
#include "tests/characterization.hh"
|
#include "tests/characterization.hh"
|
||||||
#include "parsed-derivations.hh"
|
#include "parsed-derivations.hh"
|
||||||
#include "types.hh"
|
#include "types.hh"
|
||||||
|
#include "json-utils.hh"
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue