Skip to content

Commit 9914c8b

Browse files
committed
Revert build
1 parent 94db6e8 commit 9914c8b

File tree

1 file changed

+1
-48
lines changed

1 file changed

+1
-48
lines changed

rewatch/src/build.rs

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,19 @@ use crate::build::compile::{mark_modules_with_deleted_deps_dirty, mark_modules_w
1414
use crate::helpers::emojis::*;
1515
use crate::helpers::{self, get_workspace_root};
1616
use crate::sourcedirs;
17-
use ahash::AHashSet;
1817
use anyhow::{Result, anyhow};
1918
use build_types::*;
2019
use console::style;
2120
use indicatif::{ProgressBar, ProgressStyle};
2221
use log::log_enabled;
2322
use serde::Serialize;
2423
use std::ffi::OsString;
24+
use std::fmt;
2525
use std::fs::File;
2626
use std::io::{Write, stdout};
2727
use std::path::{Path, PathBuf};
2828
use std::process::Stdio;
2929
use std::time::{Duration, Instant};
30-
use std::{fmt, fs};
3130

3231
fn 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-
517472
pub 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

Comments
 (0)