@@ -14,20 +14,19 @@ use crate::build::compile::{mark_modules_with_deleted_deps_dirty, mark_modules_w
1414use crate :: helpers:: emojis:: * ;
1515use crate :: helpers:: { self , get_workspace_root} ;
1616use crate :: sourcedirs;
17- use ahash:: AHashSet ;
1817use anyhow:: { Result , anyhow} ;
1918use build_types:: * ;
2019use console:: style;
2120use indicatif:: { ProgressBar , ProgressStyle } ;
2221use log:: log_enabled;
2322use serde:: Serialize ;
2423use std:: ffi:: OsString ;
24+ use std:: fmt;
2525use std:: fs:: File ;
2626use std:: io:: { Write , stdout} ;
2727use std:: path:: { Path , PathBuf } ;
2828use std:: process:: Stdio ;
2929use std:: time:: { Duration , Instant } ;
30- use std:: { fmt, fs} ;
3130
3231fn is_dirty ( module : & Module ) -> bool {
3332 match module. source_type {
@@ -470,50 +469,6 @@ pub fn write_build_ninja(build_state: &BuildState) {
470469 }
471470}
472471
473- #[ derive( Serialize , Debug ) ]
474- pub struct SourceDirsMeta {
475- pub dirs : Vec < String > ,
476- pub pkgs : Vec < ( String , String ) > ,
477- pub generated : Vec < String > ,
478- }
479-
480- fn generate_sourcedirs_meta ( build_state : & BuildState ) {
481- let mut dir_set: AHashSet < String > = AHashSet :: new ( ) ;
482- let mut pkgs: Vec < ( String , String ) > = vec ! [ ] ;
483- for package in build_state. packages . values ( ) {
484- if package. is_local_dep {
485- if let Some ( source_files) = & package. source_files {
486- for source_file in source_files. keys ( ) {
487- if let Some ( parent) = source_file. parent ( ) {
488- dir_set. insert ( parent. to_string_lossy ( ) . into_owned ( ) ) ;
489- }
490- }
491- }
492- } else {
493- pkgs. push ( ( package. name . clone ( ) , package. path . to_string_lossy ( ) . into_owned ( ) ) ) ;
494- }
495- }
496-
497- let meta = SourceDirsMeta {
498- dirs : dir_set. into_iter ( ) . collect ( ) ,
499- pkgs,
500- generated : vec ! [ ] ,
501- } ;
502-
503- let json = serde_json:: to_string ( & meta) ;
504- match json {
505- Err ( err) => {
506- println ! ( "Error serializing .sourcedirs.json: {}" , err) ;
507- }
508- Ok ( json) => {
509- let output_path = build_state. project_root . join ( "lib/bs/.sourcedirs.json" ) ;
510- if let Err ( e) = fs:: write ( output_path, json) {
511- println ! ( "Error writing sourcedirs.json: {}" , e) ;
512- }
513- }
514- }
515- }
516-
517472pub fn build (
518473 filter : & Option < regex:: Regex > ,
519474 path : & Path ,
@@ -539,8 +494,6 @@ pub fn build(
539494 )
540495 . map_err ( |e| anyhow ! ( "Could not initialize build. Error: {e}" ) ) ?;
541496
542- generate_sourcedirs_meta ( & build_state) ;
543-
544497 match incremental_build (
545498 & mut build_state,
546499 default_timing,
0 commit comments