From 0e71ca5e9c2e12b37696a9261cc7bda999076918 Mon Sep 17 00:00:00 2001 From: grandizzy Date: Thu, 13 Jun 2024 22:54:54 +0300 Subject: [PATCH] Changes after review: reuse MultiCompilerLanguage::FILE_EXTENSIONS --- crates/forge/bin/cmd/build.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/forge/bin/cmd/build.rs b/crates/forge/bin/cmd/build.rs index c062145177a4..82d5c834e3e2 100644 --- a/crates/forge/bin/cmd/build.rs +++ b/crates/forge/bin/cmd/build.rs @@ -3,7 +3,11 @@ use clap::Parser; use eyre::Result; use foundry_cli::{opts::CoreBuildArgs, utils::LoadConfig}; use foundry_common::compile::ProjectCompiler; -use foundry_compilers::{utils::source_files_iter, Project, ProjectCompileOutput}; +use foundry_compilers::{ + compilers::{multi::MultiCompilerLanguage, Language}, + utils::source_files_iter, + Project, ProjectCompileOutput, +}; use foundry_config::{ figment::{ self, @@ -18,9 +22,6 @@ use watchexec::config::{InitConfig, RuntimeConfig}; foundry_config::merge_impl_figment_convert!(BuildArgs, args); -// Extensions accepted by `forge build` -const BUILD_EXTENSIONS: &[&str] = &["sol", "yul", "vy", "vyi"]; - /// CLI arguments for `forge build`. /// /// CLI arguments take the highest precedence in the Config/Figment hierarchy. @@ -87,7 +88,7 @@ impl BuildArgs { let mut files = vec![]; if let Some(dirs) = self.args.paths { for dir in dirs { - files.extend(source_files_iter(dir, BUILD_EXTENSIONS)); + files.extend(source_files_iter(dir, MultiCompilerLanguage::FILE_EXTENSIONS)); } }