pub fn compile(&self) -> Result<ProjectCompileOutput> {
        let mut sources = self.sources()?;
        // add all libraries to the source set while keeping track of their actual disk path
        let mut source_name_path = HashMap::new();
        let mut path_source_name = HashMap::new();
        for (import, (source, path)) in self.resolved_libraries(&sources)? {
            // inserting with absolute path here and keep track of the source name <-> path mappings
            sources.insert(path.clone(), source);
            path_source_name.insert(path.clone(), import.clone());
            source_name_path.insert(import, path);
        }

        // If there's a cache set, filter to only re-compile the files which were changed
        let sources = if self.cached && self.paths.cache.exists() {
            let cache = SolFilesCache::read(&self.paths.cache)?;
            let changed_files = cache.get_changed_files(sources, Some(&self.solc_config));
            if changed_files.is_empty() {
                return Ok(ProjectCompileOutput::Unchanged)
            }
            changed_files
        } else {
            sources
        };

        // replace absolute path with source name to make solc happy
        let sources = apply_mappings(sources, path_source_name);

        let input = CompilerInput::with_sources(sources);
        let output = self.solc.compile(&input)?;
        if output.has_error() {
            return Ok(ProjectCompileOutput::Compiled((output, &self.ignored_error_codes)))
        }

        if self.cached {
            // reapply to disk paths
            let sources = apply_mappings(input.sources, source_name_path);
            // create cache file
            self.write_cache_file(sources)?;
        }

        self.artifacts.on_output(&output, &self.paths)?;
        Ok(ProjectCompileOutput::Compiled((output, &self.ignored_error_codes)))
    }
/// Attempts to compile the contracts found at the configured location.
///
/// NOTE: this does not check if the contracts were successfully compiled, see
/// `CompilerOutput::has_error` instead.
Attempts to compile the contracts found at the configured location.
NOTE: this does not check if the contracts were successfully compiled, see
`CompilerOutput::has_error` instead.
Attempts to compile the contracts found at the configured location . NOTE : this does not check if the contracts were successfully compiled see ` CompilerOutput :: has_error ` instead .
pub fn compile(&self) -> Result<ProjectCompileOutput> {
        let mut sources = self.sources()?;
        // add all libraries to the source set while keeping track of their actual disk path
        let mut source_name_path = HashMap::new();
        let mut path_source_name = HashMap::new();
        for (import, (source, path)) in self.resolved_libraries(&sources)? {
            // inserting with absolute path here and keep track of the source name <-> path mappings
            sources.insert(path.clone(), source);
            path_source_name.insert(path.clone(), import.clone());
            source_name_path.insert(import, path);
        }
        // If there's a cache set, filter to only re-compile the files which were changed
        let sources = if self.cached && self.paths.cache.exists() {
            let cache = SolFilesCache::read(&self.paths.cache)?;
            let changed_files = cache.get_changed_files(sources, Some(&self.solc_config));
            if changed_files.is_empty() {
                return Ok(ProjectCompileOutput::Unchanged)
            }
            changed_files
        } else {
            sources
        };
        // replace absolute path with source name to make solc happy
        let sources = apply_mappings(sources, path_source_name);
        let input = CompilerInput::with_sources(sources);
        let output = self.solc.compile(&input)?;
        if output.has_error() {
            return Ok(ProjectCompileOutput::Compiled((output, &self.ignored_error_codes)))
        }
        if self.cached {
            // reapply to disk paths
            let sources = apply_mappings(input.sources, source_name_path);
            // create cache file
            self.write_cache_file(sources)?;
        }
        self.artifacts.on_output(&output, &self.paths)?;
        Ok(ProjectCompileOutput::Compiled((output, &self.ignored_error_codes)))
    }
pub fn compile ( & self ) -> Result < ProjectCompileOutput > { let mut sources = self . sources ( ) ? ; // add all libraries to the source set while keeping track of their actual disk path let mut source_name_path = HashMap :: new ( ) ; let mut path_source_name = HashMap :: new ( ) ; for ( import , ( source , path ) ) in self . resolved_libraries ( & sources ) ? { // inserting with absolute path here and keep track of the source name <-> path mappings sources . insert ( path . clone ( ) , source ) ; path_source_name . insert ( path . clone ( ) , import . clone ( ) ) ; source_name_path . insert ( import , path ) ; } // If there's a cache set, filter to only re-compile the files which were changed let sources = if self . cached && self . paths . cache . exists ( ) { let cache = SolFilesCache :: read ( & self . paths . cache ) ? ; let changed_files = cache . get_changed_files ( sources , Some ( & self . solc_config ) ) ; if changed_files . is_empty ( ) { return Ok ( ProjectCompileOutput :: Unchanged ) } changed_files } else { sources } ; // replace absolute path with source name to make solc happy let sources = apply_mappings ( sources , path_source_name ) ; let input = CompilerInput :: with_sources ( sources ) ; let output = self . solc . compile ( & input ) ? ; if output . has_error ( ) { return Ok ( ProjectCompileOutput :: Compiled ( ( output , & self . ignored_error_codes ) ) ) } if self . cached { // reapply to disk paths let sources = apply_mappings ( input . sources , source_name_path ) ; // create cache file self . write_cache_file ( sources ) ? ; } self . artifacts . on_output ( & output , & self . paths ) ? ; Ok ( ProjectCompileOutput :: Compiled ( ( output , & self . ignored_error_codes ) ) ) }
Attempts to compile the contracts found at the configured location.
Attempts to compile the contracts found at the configured location .
&self