@@ -480,6 +480,7 @@ pub fn get_source_files(
480480    package_dir :  & Path , 
481481    filter :  & Option < regex:: Regex > , 
482482    source :  & config:: PackageSource , 
483+     build_dev_deps :  bool , 
483484)  -> AHashMap < String ,  SourceFileMeta >  { 
484485    let  mut  map:  AHashMap < String ,  SourceFileMeta >  = AHashMap :: new ( ) ; 
485486
@@ -493,16 +494,9 @@ pub fn get_source_files(
493494    } ; 
494495
495496    let  path_dir = Path :: new ( & source. dir ) ; 
496-     // don't include dev sources for now 
497-     if  type_ != & Some ( "dev" . to_string ( ) )  { 
497+     if  ( build_dev_deps && type_ == & Some ( "dev" . to_string ( ) ) )  || type_ != & Some ( "dev" . to_string ( ) )  { 
498498        match  read_folders ( filter,  package_dir,  path_dir,  recurse)  { 
499499            Ok ( files)  => map. extend ( files) , 
500-             // Err(_e) if type_ == &Some("dev".to_string()) => { 
501-             //     log::warn!( 
502-             //         "Could not read folder: {}... Probably ok as type is dev", 
503-             //         path_dir.to_string_lossy() 
504-             //     ) 
505-             // } 
506500            Err ( _e)  => log:: error!( 
507501                "Could not read folder: {:?}. Specified in dependency: {}, located {:?}..." , 
508502                path_dir. to_path_buf( ) . into_os_string( ) , 
@@ -520,13 +514,22 @@ pub fn get_source_files(
520514fn  extend_with_children ( 
521515    filter :  & Option < regex:: Regex > , 
522516    mut  build :  AHashMap < String ,  Package > , 
517+     build_dev_deps :  bool , 
523518)  -> AHashMap < String ,  Package >  { 
524519    for  ( _key,  package)  in  build. iter_mut ( )  { 
525520        let  mut  map:  AHashMap < String ,  SourceFileMeta >  = AHashMap :: new ( ) ; 
526521        package
527522            . source_folders 
528523            . par_iter ( ) 
529-             . map ( |source| get_source_files ( & package. name ,  Path :: new ( & package. path ) ,  filter,  source) ) 
524+             . map ( |source| { 
525+                 get_source_files ( 
526+                     & package. name , 
527+                     Path :: new ( & package. path ) , 
528+                     filter, 
529+                     source, 
530+                     build_dev_deps, 
531+                 ) 
532+             } ) 
530533            . collect :: < Vec < AHashMap < String ,  SourceFileMeta > > > ( ) 
531534            . into_iter ( ) 
532535            . for_each ( |source| map. extend ( source) ) ; 
@@ -568,12 +571,13 @@ pub fn make(
568571    root_folder :  & str , 
569572    workspace_root :  & Option < String > , 
570573    show_progress :  bool , 
574+     build_dev_deps :  bool , 
571575)  -> Result < AHashMap < String ,  Package > >  { 
572576    let  map = read_packages ( root_folder,  workspace_root. to_owned ( ) ,  show_progress) ?; 
573577
574578    /* Once we have the deduplicated packages, we can add the source files for each - to minimize 
575579     * the IO */ 
576-     let  result = extend_with_children ( filter,  map) ; 
580+     let  result = extend_with_children ( filter,  map,  build_dev_deps ) ; 
577581
578582    Ok ( result) 
579583} 
0 commit comments