Skip to content

Commit 819f7dc

Browse files
committed
snapshot
1 parent fbcfaf9 commit 819f7dc

File tree

3 files changed

+45
-105
lines changed

3 files changed

+45
-105
lines changed

lib/4.06.1/bsb.ml

Lines changed: 20 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,17 +3316,12 @@ val get_dev_index : unit -> t
33163316

33173317
val of_int : int -> t
33183318

3319-
val get_current_number_of_dev_groups : unit -> int
3319+
33203320

33213321

33223322
val string_of_bsb_dev_include : t -> string
33233323

3324-
(** TODO: Need reset
3325-
when generating each ninja file to provide stronger guarantee.
3326-
Here we get a weak guarantee because only dev group is
3327-
inside the toplevel project
3328-
*)
3329-
val reset : unit -> unit
3324+
33303325
end = struct
33313326
#1 "bsb_dir_index.ml"
33323327
(* Copyright (C) 2017 Authors of BuckleScript
@@ -3365,13 +3360,10 @@ let lib_dir_index = 0
33653360

33663361
let is_lib_dir x = x = lib_dir_index
33673362

3368-
let dir_index = ref 0
33693363

3370-
let get_dev_index ( ) =
3371-
incr dir_index ; !dir_index
33723364

3373-
let get_current_number_of_dev_groups =
3374-
(fun () -> !dir_index )
3365+
let get_dev_index ( ) = 1
3366+
33753367

33763368

33773369
(** bsb generate pre-defined variables [bsc_group_i_includes]
@@ -3397,7 +3389,7 @@ let string_of_bsb_dev_include i =
33973389
"bsc_group_" ^ string_of_int i ^ "_includes"
33983390

33993391

3400-
let reset () = dir_index := 0
3392+
34013393
end
34023394
module Set_gen
34033395
= struct
@@ -7773,7 +7765,6 @@ type t =
77737765
cut_generators : bool; (* note when used as a dev mode, we will always ignore it *)
77747766
bs_suffix : bool ; (* true means [.bs.js] we should pass [-bs-suffix] flag *)
77757767
gentype_config : gentype_config option;
7776-
number_of_dev_groups : int
77777768
}
77787769

77797770
end
@@ -10539,7 +10530,7 @@ val scan :
1053910530
bs_suffix:bool ->
1054010531
ignored_dirs:Set_string.t ->
1054110532
Ext_json_types.t ->
10542-
Bsb_file_groups.t * int
10533+
Bsb_file_groups.t
1054310534

1054410535
(** This function has some duplication
1054510536
from [scan],
@@ -10953,21 +10944,18 @@ let scan
1095310944
~namespace
1095410945
~bs_suffix
1095510946
~ignored_dirs
10956-
x : t * int =
10957-
Bsb_dir_index.reset ();
10958-
let output =
10959-
parse_sources {
10960-
ignored_dirs;
10961-
toplevel;
10962-
dir_index = Bsb_dir_index.lib_dir_index;
10963-
cwd = Filename.current_dir_name;
10964-
root ;
10965-
cut_generators;
10966-
namespace;
10967-
bs_suffix;
10968-
traverse = false
10969-
} x in
10970-
output, Bsb_dir_index.get_current_number_of_dev_groups ()
10947+
x : t =
10948+
parse_sources {
10949+
ignored_dirs;
10950+
toplevel;
10951+
dir_index = Bsb_dir_index.lib_dir_index;
10952+
cwd = Filename.current_dir_name;
10953+
root ;
10954+
cut_generators;
10955+
namespace;
10956+
bs_suffix;
10957+
traverse = false
10958+
} x
1097110959

1097210960

1097310961

@@ -11745,7 +11733,7 @@ let interpret_json
1174511733
| Some sources ->
1174611734
let cut_generators =
1174711735
extract_boolean map Bsb_build_schemas.cut_generators false in
11748-
let groups, number_of_dev_groups = Bsb_parse_sources.scan
11736+
let groups = Bsb_parse_sources.scan
1174911737
~ignored_dirs:(extract_ignored_dirs map)
1175011738
~toplevel
1175111739
~root: per_proj_dir
@@ -11789,7 +11777,6 @@ let interpret_json
1178911777
entries;
1179011778
generators = extract_generators map ;
1179111779
cut_generators ;
11792-
number_of_dev_groups;
1179311780
}
1179411781
| None ->
1179511782
Bsb_exception.invalid_spec
@@ -13753,7 +13740,7 @@ let output_ninja_and_namespace_map
1375313740
namespace ;
1375413741
warning;
1375513742
gentype_config;
13756-
number_of_dev_groups;
13743+
1375713744
} : Bsb_config_types.t) : unit
1375813745
=
1375913746
let lib_artifacts_dir = !Bsb_global_backend.lib_artifacts_dir in
@@ -13801,19 +13788,6 @@ let output_ninja_and_namespace_map
1380113788
|] oc
1380213789
in
1380313790
let bs_groups, bsc_lib_dirs, static_resources =
13804-
if number_of_dev_groups = 0 then
13805-
let bs_group, source_dirs,static_resources =
13806-
Ext_list.fold_left bs_file_groups (Map_string.empty,[],[])
13807-
(fun (acc, dirs,acc_resources) ({sources ; dir; resources } as x)
13808-
->
13809-
Bsb_db_util.merge acc sources ,
13810-
(if Bsb_file_groups.is_empty x then dirs else dir::dirs) ,
13811-
( if resources = [] then acc_resources
13812-
else Ext_list.map_append resources acc_resources (fun x -> dir // x ) )
13813-
) in
13814-
Bsb_db_util.sanity_check bs_group;
13815-
[|bs_group|], source_dirs, static_resources
13816-
else
1381713791
(* number_of_dev_groups = 1 -- all devs share the same group *)
1381813792
let bs_groups = Array.init 2 (fun _ -> Map_string.empty) in
1381913793
let source_dirs = Array.init 2 (fun _ -> []) in

lib/4.06.1/bsb_helper.ml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,12 @@ val get_dev_index : unit -> t
3737

3838
val of_int : int -> t
3939

40-
val get_current_number_of_dev_groups : unit -> int
40+
4141

4242

4343
val string_of_bsb_dev_include : t -> string
4444

45-
(** TODO: Need reset
46-
when generating each ninja file to provide stronger guarantee.
47-
Here we get a weak guarantee because only dev group is
48-
inside the toplevel project
49-
*)
50-
val reset : unit -> unit
45+
5146
end = struct
5247
#1 "bsb_dir_index.ml"
5348
(* Copyright (C) 2017 Authors of BuckleScript
@@ -86,13 +81,10 @@ let lib_dir_index = 0
8681

8782
let is_lib_dir x = x = lib_dir_index
8883

89-
let dir_index = ref 0
9084

91-
let get_dev_index ( ) =
92-
incr dir_index ; !dir_index
9385

94-
let get_current_number_of_dev_groups =
95-
(fun () -> !dir_index )
86+
let get_dev_index ( ) = 1
87+
9688

9789

9890
(** bsb generate pre-defined variables [bsc_group_i_includes]
@@ -118,7 +110,7 @@ let string_of_bsb_dev_include i =
118110
"bsc_group_" ^ string_of_int i ^ "_includes"
119111

120112

121-
let reset () = dir_index := 0
113+
122114
end
123115
module Ext_bytes : sig
124116
#1 "ext_bytes.mli"

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 20 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -3316,17 +3316,12 @@ val get_dev_index : unit -> t
33163316

33173317
val of_int : int -> t
33183318

3319-
val get_current_number_of_dev_groups : unit -> int
3319+
33203320

33213321

33223322
val string_of_bsb_dev_include : t -> string
33233323

3324-
(** TODO: Need reset
3325-
when generating each ninja file to provide stronger guarantee.
3326-
Here we get a weak guarantee because only dev group is
3327-
inside the toplevel project
3328-
*)
3329-
val reset : unit -> unit
3324+
33303325
end = struct
33313326
#1 "bsb_dir_index.ml"
33323327
(* Copyright (C) 2017 Authors of BuckleScript
@@ -3365,13 +3360,10 @@ let lib_dir_index = 0
33653360

33663361
let is_lib_dir x = x = lib_dir_index
33673362

3368-
let dir_index = ref 0
33693363

3370-
let get_dev_index ( ) =
3371-
incr dir_index ; !dir_index
33723364

3373-
let get_current_number_of_dev_groups =
3374-
(fun () -> !dir_index )
3365+
let get_dev_index ( ) = 1
3366+
33753367

33763368

33773369
(** bsb generate pre-defined variables [bsc_group_i_includes]
@@ -3397,7 +3389,7 @@ let string_of_bsb_dev_include i =
33973389
"bsc_group_" ^ string_of_int i ^ "_includes"
33983390

33993391

3400-
let reset () = dir_index := 0
3392+
34013393
end
34023394
module Set_gen
34033395
= struct
@@ -7779,7 +7771,6 @@ type t =
77797771
cut_generators : bool; (* note when used as a dev mode, we will always ignore it *)
77807772
bs_suffix : bool ; (* true means [.bs.js] we should pass [-bs-suffix] flag *)
77817773
gentype_config : gentype_config option;
7782-
number_of_dev_groups : int
77837774
}
77847775

77857776
end
@@ -10571,7 +10562,7 @@ val scan :
1057110562
bs_suffix:bool ->
1057210563
ignored_dirs:Set_string.t ->
1057310564
Ext_json_types.t ->
10574-
Bsb_file_groups.t * int
10565+
Bsb_file_groups.t
1057510566

1057610567
(** This function has some duplication
1057710568
from [scan],
@@ -10985,21 +10976,18 @@ let scan
1098510976
~namespace
1098610977
~bs_suffix
1098710978
~ignored_dirs
10988-
x : t * int =
10989-
Bsb_dir_index.reset ();
10990-
let output =
10991-
parse_sources {
10992-
ignored_dirs;
10993-
toplevel;
10994-
dir_index = Bsb_dir_index.lib_dir_index;
10995-
cwd = Filename.current_dir_name;
10996-
root ;
10997-
cut_generators;
10998-
namespace;
10999-
bs_suffix;
11000-
traverse = false
11001-
} x in
11002-
output, Bsb_dir_index.get_current_number_of_dev_groups ()
10979+
x : t =
10980+
parse_sources {
10981+
ignored_dirs;
10982+
toplevel;
10983+
dir_index = Bsb_dir_index.lib_dir_index;
10984+
cwd = Filename.current_dir_name;
10985+
root ;
10986+
cut_generators;
10987+
namespace;
10988+
bs_suffix;
10989+
traverse = false
10990+
} x
1100310991

1100410992

1100510993

@@ -11894,7 +11882,7 @@ let interpret_json
1189411882
| Some sources ->
1189511883
let cut_generators =
1189611884
extract_boolean map Bsb_build_schemas.cut_generators false in
11897-
let groups, number_of_dev_groups = Bsb_parse_sources.scan
11885+
let groups = Bsb_parse_sources.scan
1189811886
~ignored_dirs:(extract_ignored_dirs map)
1189911887
~toplevel
1190011888
~root: per_proj_dir
@@ -11938,7 +11926,6 @@ let interpret_json
1193811926
entries;
1193911927
generators = extract_generators map ;
1194011928
cut_generators ;
11941-
number_of_dev_groups;
1194211929
}
1194311930
| None ->
1194411931
Bsb_exception.invalid_spec
@@ -13902,7 +13889,7 @@ let output_ninja_and_namespace_map
1390213889
namespace ;
1390313890
warning;
1390413891
gentype_config;
13905-
number_of_dev_groups;
13892+
1390613893
} : Bsb_config_types.t) : unit
1390713894
=
1390813895
let lib_artifacts_dir = !Bsb_global_backend.lib_artifacts_dir in
@@ -13950,19 +13937,6 @@ let output_ninja_and_namespace_map
1395013937
|] oc
1395113938
in
1395213939
let bs_groups, bsc_lib_dirs, static_resources =
13953-
if number_of_dev_groups = 0 then
13954-
let bs_group, source_dirs,static_resources =
13955-
Ext_list.fold_left bs_file_groups (Map_string.empty,[],[])
13956-
(fun (acc, dirs,acc_resources) ({sources ; dir; resources } as x)
13957-
->
13958-
Bsb_db_util.merge acc sources ,
13959-
(if Bsb_file_groups.is_empty x then dirs else dir::dirs) ,
13960-
( if resources = [] then acc_resources
13961-
else Ext_list.map_append resources acc_resources (fun x -> dir // x ) )
13962-
) in
13963-
Bsb_db_util.sanity_check bs_group;
13964-
[|bs_group|], source_dirs, static_resources
13965-
else
1396613940
(* number_of_dev_groups = 1 -- all devs share the same group *)
1396713941
let bs_groups = Array.init 2 (fun _ -> Map_string.empty) in
1396813942
let source_dirs = Array.init 2 (fun _ -> []) in

0 commit comments

Comments
 (0)