diff --git a/crates/compilers/src/config.rs b/crates/compilers/src/config.rs index c7c8e8c21..5be5a7009 100644 --- a/crates/compilers/src/config.rs +++ b/crates/compilers/src/config.rs @@ -33,6 +33,8 @@ pub struct ProjectPathsConfig { pub cache: PathBuf, /// Where to store build artifacts pub artifacts: PathBuf, + /// Where to store snapshots + pub snapshots: PathBuf, /// Where to store the build info files pub build_infos: PathBuf, /// Where to find sources @@ -529,6 +531,7 @@ impl ProjectPathsConfig { cache, artifacts, build_infos, + snapshots, sources, tests, scripts, @@ -544,6 +547,7 @@ impl ProjectPathsConfig { cache, artifacts, build_infos, + snapshots, sources, tests, scripts, @@ -734,6 +738,7 @@ pub struct ProjectPathsConfigBuilder { cache: Option, artifacts: Option, build_infos: Option, + snapshots: Option, sources: Option, tests: Option, scripts: Option, @@ -779,6 +784,11 @@ impl ProjectPathsConfigBuilder { self } + pub fn snapshots(mut self, snapshots: impl Into) -> Self { + self.snapshots = Some(utils::canonicalized(snapshots)); + self + } + /// Specifically disallow additional libraries pub fn no_libs(mut self) -> Self { self.libraries = Some(Vec::new()); @@ -864,6 +874,7 @@ impl ProjectPathsConfigBuilder { .unwrap_or_else(|| root.join("cache").join(SOLIDITY_FILES_CACHE_FILENAME)), build_infos: self.build_infos.unwrap_or_else(|| artifacts.join("build-info")), artifacts, + snapshots: self.snapshots.unwrap_or_else(|| root.join("snapshots")), sources: self.sources.unwrap_or_else(|| ProjectPathsConfig::find_source_dir(&root)), tests: self.tests.unwrap_or_else(|| root.join("test")), scripts: self.scripts.unwrap_or_else(|| root.join("script")),