@@ -6964,7 +6964,7 @@ let internal_override_package_specs str =
6964
6964
) String_set. empty lst
6965
6965
6966
6966
6967
- let generate_merlin = ref false
6967
+ let generate_merlin = ref true
6968
6968
6969
6969
let get_generate_merlin () = ! generate_merlin
6970
6970
@@ -7291,7 +7291,7 @@ module Rules = struct
7291
7291
print_rule oc ~description ?depfile ?restat ~command name;
7292
7292
self.used < - true
7293
7293
end ;
7294
- self.rule_name
7294
+ self.rule_name
7295
7295
} in self
7296
7296
7297
7297
@@ -7346,7 +7346,7 @@ module Rules = struct
7346
7346
(* *************************************)
7347
7347
(* below are rules not local any more *)
7348
7348
(* *************************************)
7349
-
7349
+
7350
7350
(* [bsc_lib_includes] are fixed for libs
7351
7351
[bsc_extra_includes] are for app test etc
7352
7352
it wil be
@@ -7394,10 +7394,10 @@ let output_build
7394
7394
output_string oc output ;
7395
7395
outputs |> List. iter (fun s -> output_string oc " " ; output_string oc s );
7396
7396
begin match implicit_outputs with
7397
- | [] -> ()
7398
- | _ ->
7399
- output_string oc " | " ;
7400
- implicit_outputs |> List. iter (fun s -> output_string oc " " ; output_string oc s)
7397
+ | [] -> ()
7398
+ | _ ->
7399
+ output_string oc " | " ;
7400
+ implicit_outputs |> List. iter (fun s -> output_string oc " " ; output_string oc s)
7401
7401
end ;
7402
7402
output_string oc " : " ;
7403
7403
output_string oc rule;
@@ -7441,12 +7441,12 @@ let output_build
7441
7441
output_string oc s ; output_string oc " \n "
7442
7442
) xs
7443
7443
end ;
7444
- begin match restat with
7445
- | None -> ()
7446
- | Some () ->
7447
- output_string oc " " ;
7448
- output_string oc " restat = 1 \n "
7449
- end
7444
+ begin match restat with
7445
+ | None -> ()
7446
+ | Some () ->
7447
+ output_string oc " " ;
7448
+ output_string oc " restat = 1 \n "
7449
+ end
7450
7450
7451
7451
7452
7452
let phony ?(order_only_deps =[] ) ~inputs ~output oc =
@@ -7496,9 +7496,9 @@ let (++) (us : info) (vs : info) =
7496
7496
else
7497
7497
{
7498
7498
all_config_deps = us.all_config_deps @ vs.all_config_deps
7499
- ;
7499
+ ;
7500
7500
all_installs = us.all_installs @ vs.all_installs
7501
- }
7501
+ }
7502
7502
7503
7503
7504
7504
@@ -7527,39 +7527,39 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7527
7527
let output_cmj = output_file_sans_extension ^ Literals. suffix_cmj in
7528
7528
let output_js =
7529
7529
String_set. fold (fun s acc ->
7530
- let prefix =
7530
+ let prefix =
7531
7531
if s = Literals. commonjs then
7532
7532
Bsb_config. common_js_prefix
7533
7533
else if s = Literals. amdjs then
7534
7534
Bsb_config. amd_js_prefix
7535
7535
else Bsb_config. goog_prefix
7536
7536
in
7537
- (Bsb_config. proj_rel @@ prefix
7538
- output_file_sans_extension ^ Literals. suffix_js) :: acc
7539
- ) package_specs []
7537
+ (Bsb_config. proj_rel @@ prefix
7538
+ output_file_sans_extension ^ Literals. suffix_js) :: acc
7539
+ ) package_specs []
7540
7540
in
7541
7541
(* let output_mldeps = output_file_sans_extension ^ Literals.suffix_mldeps in *)
7542
7542
(* let output_mlideps = output_file_sans_extension ^ Literals.suffix_mlideps in *)
7543
7543
let shadows =
7544
7544
let package_flags =
7545
7545
( " bs_package_flags" ,
7546
7546
`Append
7547
- (String_set. fold (fun s acc ->
7548
- acc ^ " -bs-package-output " ^ s ^ " :" ^
7549
- if s = Literals. amdjs then
7550
- (Bsb_config. amd_js_prefix @@ Filename. dirname output_cmi)
7551
- else if s = Literals. commonjs then
7552
- (Bsb_config. common_js_prefix @@ Filename. dirname output_cmi)
7553
- else
7554
- (Bsb_config. goog_prefix @@ Filename. dirname output_cmi)
7555
- ) package_specs " " )
7547
+ (String_set. fold (fun s acc ->
7548
+ acc ^ " -bs-package-output " ^ s ^ " :" ^
7549
+ if s = Literals. amdjs then
7550
+ (Bsb_config. amd_js_prefix @@ Filename. dirname output_cmi)
7551
+ else if s = Literals. commonjs then
7552
+ (Bsb_config. common_js_prefix @@ Filename. dirname output_cmi)
7553
+ else
7554
+ (Bsb_config. goog_prefix @@ Filename. dirname output_cmi)
7555
+ ) package_specs " " )
7556
7556
) ::
7557
7557
(if group.dir_index = 0 then [] else
7558
- [(" bsc_extra_includes" ,
7559
- `Overwrite
7560
- (" ${" ^ Bsb_build_util. string_of_bsb_dev_include group.dir_index ^ " }" )
7561
- )]
7562
- )
7558
+ [(" bsc_extra_includes" ,
7559
+ `Overwrite
7560
+ (" ${" ^ Bsb_build_util. string_of_bsb_dev_include group.dir_index ^ " }" )
7561
+ )]
7562
+ )
7563
7563
in
7564
7564
7565
7565
match bs_dependencies with
@@ -7577,6 +7577,17 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7577
7577
~output: output_ml
7578
7578
~input
7579
7579
~rule: Rules. build_ml_from_mll ;
7580
+ let install_files files =
7581
+ files
7582
+ |> List. iter
7583
+ (
7584
+ fun x ->
7585
+ output_build oc
7586
+ ~output: (Bsb_config. proj_rel @@
7587
+ Bsb_config. ocaml_bin_install_prefix @@ Filename. basename x)
7588
+ ~input: x
7589
+ ~rule: Rules. copy_resources
7590
+ ) in
7580
7591
begin match kind with
7581
7592
| `Mll
7582
7593
| `Ml
@@ -7601,7 +7612,7 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7601
7612
~input: output_mlast
7602
7613
~rule: Rules. build_bin_deps
7603
7614
?shadows:(if group.dir_index = 0 then None else Some [" group" , `Overwrite (string_of_int group.dir_index)])
7604
- ;
7615
+ ;
7605
7616
let rule_name , cm_outputs , deps =
7606
7617
if module_info.mli = Mli_empty then
7607
7618
Rules. build_cmj_cmi_js, [output_cmi], []
@@ -7613,7 +7624,7 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7613
7624
| None -> shadows
7614
7625
| Some cmd ->
7615
7626
(" postbuild" ,
7616
- `Overwrite (" && " ^ cmd ^ " " ^ String. concat " " output_js)) :: shadows
7627
+ `Overwrite (" && " ^ cmd ^ " " ^ String. concat " " output_js)) :: shadows
7617
7628
in
7618
7629
output_build oc
7619
7630
~output: output_cmj
@@ -7623,20 +7634,10 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7623
7634
~implicit_deps: deps
7624
7635
~rule: rule_name ;
7625
7636
if installable then
7626
- begin
7627
- output_cmj :: cm_outputs
7628
- |> List. iter
7629
- (
7630
- fun x ->
7631
- output_build oc
7632
- ~output: (Bsb_config. proj_rel @@
7633
- Bsb_config. ocaml_bin_install_prefix @@ Filename. basename x)
7634
- ~input: x
7635
- ~rule: Rules. copy_resources
7636
- )
7637
- end;
7638
- {all_config_deps = [output_mlastd]; all_installs = [output_cmi]; }
7639
-
7637
+ install_files (input::output_cmj :: cm_outputs)
7638
+ ;
7639
+ {all_config_deps = [output_mlastd]; all_installs = [output_cmi]; }
7640
+
7640
7641
end
7641
7642
| `Mli
7642
7643
| `Rei ->
@@ -7653,7 +7654,7 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7653
7654
~input: output_mliast
7654
7655
~rule: Rules. build_bin_deps
7655
7656
?shadows:(if group.dir_index = 0 then None
7656
- else Some [Bsb_build_schemas. bsb_dir_group, `Overwrite (string_of_int group.dir_index)])
7657
+ else Some [Bsb_build_schemas. bsb_dir_group, `Overwrite (string_of_int group.dir_index)])
7657
7658
;
7658
7659
output_build oc
7659
7660
~shadows
@@ -7662,20 +7663,13 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7662
7663
(* ~implicit_deps:[output_mliastd] *)
7663
7664
~rule: Rules. build_cmi;
7664
7665
if installable then
7665
- begin
7666
- output_build oc
7667
- ~output: (Bsb_config. proj_rel @@
7668
- Bsb_config. ocaml_bin_install_prefix @@
7669
- Filename. basename output_cmi)
7670
- ~input: output_cmi
7671
- ~rule: Rules. copy_resources
7672
- end ;
7673
- {
7674
- all_config_deps = [output_mliastd];
7675
- all_installs = [output_cmi] ;
7676
-
7677
- }
7678
-
7666
+ install_files [output_cmi; input];
7667
+ {
7668
+ all_config_deps = [output_mliastd];
7669
+ all_installs = [output_cmi] ;
7670
+
7671
+ }
7672
+
7679
7673
end
7680
7674
in
7681
7675
begin match module_info.ml with
@@ -7707,7 +7701,7 @@ let handle_file_group oc ~package_specs ~js_post_build_cmd acc (group: Bsb_buil
7707
7701
7708
7702
7709
7703
let handle_file_groups oc ~package_specs ~js_post_build_cmd (file_groups : Bsb_build_ui.file_group list ) st =
7710
- List. fold_left (handle_file_group oc ~package_specs ~js_post_build_cmd ) st file_groups
7704
+ List. fold_left (handle_file_group oc ~package_specs ~js_post_build_cmd ) st file_groups
7711
7705
7712
7706
end
7713
7707
module Bsb_gen : sig
0 commit comments