@@ -501,7 +501,7 @@ pub fn get_source_files(
501501 package_dir : & Path ,
502502 filter : & Option < regex:: Regex > ,
503503 source : & config:: PackageSource ,
504- dev_deps : DevDeps ,
504+ build_dev_deps : bool ,
505505) -> AHashMap < PathBuf , SourceFileMeta > {
506506 let mut map: AHashMap < PathBuf , SourceFileMeta > = AHashMap :: new ( ) ;
507507
@@ -515,9 +515,8 @@ pub fn get_source_files(
515515 } ;
516516
517517 let path_dir = Path :: new ( & source. dir ) ;
518- match ( dev_deps, type_) {
519- ( DevDeps :: DontBuild , Some ( type_) ) if type_ == "dev" => ( ) ,
520- ( DevDeps :: Clean , Some ( type_) ) if type_ == "dev" && !package_dir. join ( path_dir) . exists ( ) => ( ) ,
518+ match ( build_dev_deps, type_) {
519+ ( false , Some ( type_) ) if type_ == "dev" => ( ) ,
521520 _ => match read_folders ( filter, package_dir, path_dir, recurse) {
522521 Ok ( files) => map. extend ( files) ,
523522
@@ -538,14 +537,22 @@ pub fn get_source_files(
538537fn extend_with_children (
539538 filter : & Option < regex:: Regex > ,
540539 mut build : AHashMap < String , Package > ,
541- dev_deps : DevDeps ,
540+ build_dev_deps : bool ,
542541) -> AHashMap < String , Package > {
543542 for ( _key, package) in build. iter_mut ( ) {
544543 let mut map: AHashMap < PathBuf , SourceFileMeta > = AHashMap :: new ( ) ;
545544 package
546545 . source_folders
547546 . par_iter ( )
548- . map ( |source| get_source_files ( & package. name , Path :: new ( & package. path ) , filter, source, dev_deps) )
547+ . map ( |source| {
548+ get_source_files (
549+ & package. name ,
550+ Path :: new ( & package. path ) ,
551+ filter,
552+ source,
553+ build_dev_deps,
554+ )
555+ } )
549556 . collect :: < Vec < AHashMap < PathBuf , SourceFileMeta > > > ( )
550557 . into_iter ( )
551558 . for_each ( |source| map. extend ( source) ) ;
@@ -575,13 +582,6 @@ fn extend_with_children(
575582 build
576583}
577584
578- #[ derive( Clone , Copy ) ]
579- pub enum DevDeps {
580- Build ,
581- DontBuild ,
582- Clean ,
583- }
584-
585585/// Make turns a folder, that should contain a config, into a tree of Packages.
586586/// It does so in two steps:
587587/// 1. Get all the packages parsed, and take all the source folders from the config
@@ -594,13 +594,13 @@ pub fn make(
594594 root_folder : & Path ,
595595 workspace_root : & Option < PathBuf > ,
596596 show_progress : bool ,
597- dev_deps : DevDeps ,
597+ build_dev_deps : bool ,
598598) -> Result < AHashMap < String , Package > > {
599599 let map = read_packages ( root_folder, workspace_root, show_progress) ?;
600600
601601 /* Once we have the deduplicated packages, we can add the source files for each - to minimize
602602 * the IO */
603- let result = extend_with_children ( filter, map, dev_deps ) ;
603+ let result = extend_with_children ( filter, map, build_dev_deps ) ;
604604
605605 Ok ( result)
606606}
0 commit comments