Skip to content

feat: add snapshots directory #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/compilers/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ pub struct ProjectPathsConfig<L = MultiCompilerLanguage> {
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
Expand Down Expand Up @@ -529,6 +531,7 @@ impl<L> ProjectPathsConfig<L> {
cache,
artifacts,
build_infos,
snapshots,
sources,
tests,
scripts,
Expand All @@ -544,6 +547,7 @@ impl<L> ProjectPathsConfig<L> {
cache,
artifacts,
build_infos,
snapshots,
sources,
tests,
scripts,
Expand Down Expand Up @@ -734,6 +738,7 @@ pub struct ProjectPathsConfigBuilder {
cache: Option<PathBuf>,
artifacts: Option<PathBuf>,
build_infos: Option<PathBuf>,
snapshots: Option<PathBuf>,
sources: Option<PathBuf>,
tests: Option<PathBuf>,
scripts: Option<PathBuf>,
Expand Down Expand Up @@ -779,6 +784,11 @@ impl ProjectPathsConfigBuilder {
self
}

pub fn snapshots(mut self, snapshots: impl Into<PathBuf>) -> Self {
self.snapshots = Some(utils::canonicalized(snapshots));
self
}

/// Specifically disallow additional libraries
pub fn no_libs(mut self) -> Self {
self.libraries = Some(Vec::new());
Expand Down Expand Up @@ -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")),
Expand Down