Skip to content

Commit cf1b90c

Browse files
committed
Revert changes
1 parent 3ec4278 commit cf1b90c

File tree

3 files changed

+20
-25
lines changed

3 files changed

+20
-25
lines changed

rewatch/src/build.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ pub mod packages;
88
pub mod parse;
99
pub mod read_compile_state;
1010

11-
use self::compile::compiler_args;
12-
use self::parse::parser_args;
1311
use crate::build::compile::{mark_modules_with_deleted_deps_dirty, mark_modules_with_expired_deps_dirty};
14-
use crate::build::packages::DevDeps;
1512
use crate::helpers::emojis::*;
1613
use crate::helpers::{self, get_workspace_root};
1714
use crate::sourcedirs;
@@ -29,6 +26,9 @@ use std::path::{Path, PathBuf};
2926
use std::process::Stdio;
3027
use std::time::{Duration, Instant};
3128

29+
use self::compile::compiler_args;
30+
use self::parse::parser_args;
31+
3232
fn is_dirty(module: &Module) -> bool {
3333
match module.source_type {
3434
SourceType::SourceFile(SourceFile {
@@ -133,11 +133,7 @@ pub fn initialize_build(
133133
&project_root,
134134
&workspace_root,
135135
show_progress,
136-
if build_dev_deps {
137-
DevDeps::Build
138-
} else {
139-
DevDeps::DontBuild
140-
},
136+
build_dev_deps,
141137
)?;
142138
let timing_package_tree_elapsed = timing_package_tree.elapsed();
143139

rewatch/src/build/clean.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::build_types::*;
22
use super::packages;
3-
use crate::build::packages::DevDeps;
43
use crate::helpers;
54
use crate::helpers::emojis::*;
65
use ahash::AHashSet;
@@ -342,7 +341,7 @@ pub fn clean(path: &Path, show_progress: bool, snapshot_output: bool) -> Result<
342341
show_progress,
343342
// Build the package tree with dev dependencies.
344343
// They should always be cleaned if they are there.
345-
DevDeps::Clean,
344+
true,
346345
)?;
347346
let root_config_name = packages::read_package_name(&project_root)?;
348347
let bsc_path = helpers::get_bsc();

rewatch/src/build/packages.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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(
538537
fn 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

Comments
 (0)