Skip to content

Commit c91273b

Browse files
committed
remove bsb_dir_index
1 parent a45a5b3 commit c91273b

File tree

7 files changed

+9
-94
lines changed

7 files changed

+9
-94
lines changed

jscomp/bsb/bsb_file_groups.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type file_group =
4040
sources : Bsb_db.t;
4141
resources : string list ;
4242
public : public ;
43-
dir_index : Bsb_dir_index.t ;
43+
dir_index : bool ;
4444
generators : build_generator list ;
4545
(* output of [generators] should be added to [sources],
4646
if it is [.ml,.mli,.re,.rei]

jscomp/bsb/bsb_file_groups.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type file_group =
4040
sources : Bsb_db.t;
4141
resources : string list ;
4242
public : public ;
43-
dir_index : Bsb_dir_index.t ;
43+
dir_index : bool ; (* false means not in dev mode *)
4444
generators : build_generator list ;
4545
(* output of [generators] should be added to [sources],
4646
if it is [.ml,.mli,.re,.rei]

jscomp/bsb/bsb_ninja_file_groups.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ let make_common_shadows
6565
let emit_module_build
6666
(rules : Bsb_ninja_rule.builtin)
6767
(package_specs : Bsb_package_specs.t)
68-
(group_dir_index : Bsb_dir_index.t)
68+
(is_dev : bool)
6969
oc
7070
~bs_suffix
7171
js_post_build_cmd
@@ -75,7 +75,6 @@ let emit_module_build
7575
let has_intf_file = module_info.info = Ml_mli in
7676
let is_re = module_info.is_re in
7777
let filename_sans_extension = module_info.name_sans_extension in
78-
let is_dev = not (Bsb_dir_index.is_lib_dir group_dir_index) in
7978
let input_impl =
8079
Bsb_config.proj_rel
8180
(filename_sans_extension ^ if is_re then Literals.suffix_re else Literals.suffix_ml ) in

jscomp/bsb/bsb_ninja_gen.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ let output_ninja_and_namespace_map
169169
let static_resources =
170170
Ext_list.fold_left bs_file_groups [] (fun (acc_resources : string list) {sources; dir; resources; dir_index}
171171
->
172-
let dir_index = (dir_index :> int) in
172+
let dir_index = if dir_index then 1 else 0 in
173173
bs_groups.(dir_index) <- Bsb_db_util.merge bs_groups.(dir_index) sources ;
174174
source_dirs.(dir_index) <- dir :: source_dirs.(dir_index);
175175
Ext_list.map_append resources acc_resources (fun x -> dir//x)

jscomp/bsb/bsb_parse_sources.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let errorf x fmt =
4545

4646
type cxt = {
4747
toplevel : bool ;
48-
dir_index : Bsb_dir_index.t ;
48+
dir_index : bool;
4949
cwd : string ;
5050
root : string;
5151
cut_generators : bool;
@@ -350,7 +350,7 @@ and parsing_single_source ({toplevel; dir_index ; cwd} as cxt ) (x : Ext_json_ty
350350
: t =
351351
match x with
352352
| Str { str = dir } ->
353-
if not toplevel && not (Bsb_dir_index.is_lib_dir dir_index) then
353+
if not toplevel && dir_index then
354354
Bsb_file_groups.empty
355355
else
356356
parsing_source_dir_map
@@ -361,10 +361,10 @@ and parsing_single_source ({toplevel; dir_index ; cwd} as cxt ) (x : Ext_json_ty
361361
let current_dir_index =
362362
match Map_string.find_opt map Bsb_build_schemas.type_ with
363363
| Some (Str {str="dev"}) ->
364-
Bsb_dir_index.get_dev_index ()
364+
true
365365
| Some _ -> Bsb_exception.config_error x {|type field expect "dev" literal |}
366366
| None -> dir_index in
367-
if not toplevel && not (Bsb_dir_index.is_lib_dir current_dir_index) then
367+
if not toplevel && current_dir_index then
368368
Bsb_file_groups.empty
369369
else
370370
let dir =
@@ -405,7 +405,7 @@ let scan
405405
parse_sources {
406406
ignored_dirs;
407407
toplevel;
408-
dir_index = Bsb_dir_index.lib_dir_index;
408+
dir_index = false;
409409
cwd = Filename.current_dir_name;
410410
root ;
411411
cut_generators;

jscomp/ext/bsb_dir_index.ml

Lines changed: 0 additions & 45 deletions
This file was deleted.

jscomp/ext/bsb_dir_index.mli

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)