foundry_config/
soldeer.rsuse std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct MapDependency {
pub version: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rev: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct SoldeerDependencyConfig(BTreeMap<String, SoldeerDependencyValue>);
impl AsRef<Self> for SoldeerDependencyConfig {
fn as_ref(&self) -> &Self {
self
}
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SoldeerDependencyValue {
Map(MapDependency),
Str(String),
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Default)]
#[serde(rename_all = "lowercase")]
pub enum RemappingsLocation {
#[default]
Txt,
Config,
}
fn default_true() -> bool {
true
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
pub struct SoldeerConfig {
#[serde(default = "default_true")]
pub remappings_generate: bool,
#[serde(default)]
pub remappings_regenerate: bool,
#[serde(default = "default_true")]
pub remappings_version: bool,
#[serde(default)]
pub remappings_prefix: String,
#[serde(default)]
pub remappings_location: RemappingsLocation,
#[serde(default)]
pub recursive_deps: bool,
}
impl AsRef<Self> for SoldeerConfig {
fn as_ref(&self) -> &Self {
self
}
}
impl Default for SoldeerConfig {
fn default() -> Self {
Self {
remappings_generate: true,
remappings_regenerate: false,
remappings_version: true,
remappings_prefix: String::new(),
remappings_location: Default::default(),
recursive_deps: false,
}
}
}