@@ -3276,97 +3276,6 @@ type ts = t array
3276
3276
3277
3277
3278
3278
3279
- end
3280
- module Bsb_dir_index : sig
3281
- #1 "bsb_dir_index.mli"
3282
- (* Copyright (C) 2017 Authors of BuckleScript
3283
- *
3284
- * This program is free software: you can redistribute it and/or modify
3285
- * it under the terms of the GNU Lesser General Public License as published by
3286
- * the Free Software Foundation, either version 3 of the License, or
3287
- * (at your option) any later version.
3288
- *
3289
- * In addition to the permissions granted to you by the LGPL, you may combine
3290
- * or link a "work that uses the Library" with a publicly distributed version
3291
- * of this file to produce a combined library or application, then distribute
3292
- * that combined work under the terms of your choosing, with no requirement
3293
- * to comply with the obligations normally placed on you by section 4 of the
3294
- * LGPL version 3 (or the corresponding section of a later version of the LGPL
3295
- * should you choose to use a later version).
3296
- *
3297
- * This program is distributed in the hope that it will be useful,
3298
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3299
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3300
- * GNU Lesser General Public License for more details.
3301
- *
3302
- * You should have received a copy of the GNU Lesser General Public License
3303
- * along with this program; if not, write to the Free Software
3304
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
3305
-
3306
- (** Used to index [.bsbuildcache] may not be needed if we flatten dev
3307
- into a single group
3308
- *)
3309
- type t = private int
3310
-
3311
- val lib_dir_index : t
3312
-
3313
- val is_lib_dir : t -> bool
3314
-
3315
- val get_dev_index : unit -> t
3316
-
3317
-
3318
-
3319
-
3320
-
3321
-
3322
- end = struct
3323
- #1 "bsb_dir_index.ml"
3324
- (* Copyright (C) 2017 Authors of BuckleScript
3325
- *
3326
- * This program is free software: you can redistribute it and/or modify
3327
- * it under the terms of the GNU Lesser General Public License as published by
3328
- * the Free Software Foundation, either version 3 of the License, or
3329
- * (at your option) any later version.
3330
- *
3331
- * In addition to the permissions granted to you by the LGPL, you may combine
3332
- * or link a "work that uses the Library" with a publicly distributed version
3333
- * of this file to produce a combined library or application, then distribute
3334
- * that combined work under the terms of your choosing, with no requirement
3335
- * to comply with the obligations normally placed on you by section 4 of the
3336
- * LGPL version 3 (or the corresponding section of a later version of the LGPL
3337
- * should you choose to use a later version).
3338
- *
3339
- * This program is distributed in the hope that it will be useful,
3340
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3341
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3342
- * GNU Lesser General Public License for more details.
3343
- *
3344
- * You should have received a copy of the GNU Lesser General Public License
3345
- * along with this program; if not, write to the Free Software
3346
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
3347
-
3348
- type t = int
3349
-
3350
- (**
3351
- 0 : lib
3352
- 1 : dev 1
3353
- 2 : dev 2
3354
- *)
3355
-
3356
- let lib_dir_index = 0
3357
-
3358
- let is_lib_dir x = x = lib_dir_index
3359
-
3360
-
3361
-
3362
- let get_dev_index ( ) = 1
3363
-
3364
-
3365
-
3366
-
3367
-
3368
-
3369
-
3370
3279
end
3371
3280
module Set_gen
3372
3281
= struct
@@ -4045,7 +3954,7 @@ type file_group =
4045
3954
sources : Bsb_db.t;
4046
3955
resources : string list ;
4047
3956
public : public ;
4048
- dir_index : Bsb_dir_index.t ;
3957
+ dir_index : bool ; (* false means not in dev mode *)
4049
3958
generators : build_generator list ;
4050
3959
(* output of [generators] should be added to [sources],
4051
3960
if it is [.ml,.mli,.re,.rei]
@@ -4122,7 +4031,7 @@ type file_group =
4122
4031
sources : Bsb_db.t;
4123
4032
resources : string list ;
4124
4033
public : public ;
4125
- dir_index : Bsb_dir_index.t ;
4034
+ dir_index : bool ;
4126
4035
generators : build_generator list ;
4127
4036
(* output of [generators] should be added to [sources],
4128
4037
if it is [.ml,.mli,.re,.rei]
@@ -10565,7 +10474,7 @@ let errorf x fmt =
10565
10474
10566
10475
type cxt = {
10567
10476
toplevel : bool ;
10568
- dir_index : Bsb_dir_index.t ;
10477
+ dir_index : bool ;
10569
10478
cwd : string ;
10570
10479
root : string;
10571
10480
cut_generators : bool;
@@ -10870,7 +10779,7 @@ and parsing_single_source ({toplevel; dir_index ; cwd} as cxt ) (x : Ext_json_ty
10870
10779
: t =
10871
10780
match x with
10872
10781
| Str { str = dir } ->
10873
- if not toplevel && not (Bsb_dir_index.is_lib_dir dir_index) then
10782
+ if not toplevel && dir_index then
10874
10783
Bsb_file_groups.empty
10875
10784
else
10876
10785
parsing_source_dir_map
@@ -10881,10 +10790,10 @@ and parsing_single_source ({toplevel; dir_index ; cwd} as cxt ) (x : Ext_json_ty
10881
10790
let current_dir_index =
10882
10791
match Map_string.find_opt map Bsb_build_schemas.type_ with
10883
10792
| Some (Str {str="dev"}) ->
10884
- Bsb_dir_index.get_dev_index ()
10793
+ true
10885
10794
| Some _ -> Bsb_exception.config_error x {|type field expect "dev" literal |}
10886
10795
| None -> dir_index in
10887
- if not toplevel && not (Bsb_dir_index.is_lib_dir current_dir_index) then
10796
+ if not toplevel && current_dir_index then
10888
10797
Bsb_file_groups.empty
10889
10798
else
10890
10799
let dir =
@@ -10925,7 +10834,7 @@ let scan
10925
10834
parse_sources {
10926
10835
ignored_dirs;
10927
10836
toplevel;
10928
- dir_index = Bsb_dir_index.lib_dir_index ;
10837
+ dir_index = false ;
10929
10838
cwd = Filename.current_dir_name;
10930
10839
root ;
10931
10840
cut_generators;
@@ -13411,7 +13320,7 @@ let make_common_shadows
13411
13320
let emit_module_build
13412
13321
(rules : Bsb_ninja_rule.builtin)
13413
13322
(package_specs : Bsb_package_specs.t)
13414
- (group_dir_index : Bsb_dir_index.t )
13323
+ (is_dev : bool )
13415
13324
oc
13416
13325
~bs_suffix
13417
13326
js_post_build_cmd
@@ -13421,7 +13330,6 @@ let emit_module_build
13421
13330
let has_intf_file = module_info.info = Ml_mli in
13422
13331
let is_re = module_info.is_re in
13423
13332
let filename_sans_extension = module_info.name_sans_extension in
13424
- let is_dev = not (Bsb_dir_index.is_lib_dir group_dir_index) in
13425
13333
let input_impl =
13426
13334
Bsb_config.proj_rel
13427
13335
(filename_sans_extension ^ if is_re then Literals.suffix_re else Literals.suffix_ml ) in
@@ -13762,7 +13670,7 @@ let output_ninja_and_namespace_map
13762
13670
let static_resources =
13763
13671
Ext_list.fold_left bs_file_groups [] (fun (acc_resources : string list) {sources; dir; resources; dir_index}
13764
13672
->
13765
- let dir_index = ( dir_index :> int) in
13673
+ let dir_index = if dir_index then 1 else 0 in
13766
13674
bs_groups.(dir_index) <- Bsb_db_util.merge bs_groups.(dir_index) sources ;
13767
13675
source_dirs.(dir_index) <- dir :: source_dirs.(dir_index);
13768
13676
Ext_list.map_append resources acc_resources (fun x -> dir//x)
0 commit comments