@@ -138,7 +138,8 @@ let interpret_json
138
138
since it is external configuration, no {!Bsb_build_util.convert_and_resolve_path}
139
139
*)
140
140
let bsc_flags = ref Bsb_default. bsc_flags in
141
- let ppx_flags = ref [] in
141
+ let ppx_files : string list ref = ref [] in
142
+ let ppx_checked_files : string list ref = ref [] in
142
143
let js_post_build_cmd = ref None in
143
144
let built_in_package = ref None in
144
145
let generate_merlin = ref true in
@@ -175,8 +176,8 @@ let interpret_json
175
176
| Some (Str {str})
176
177
->
177
178
Refmt_custom
178
- (Bsb_build_util. resolve_bsb_magic_file
179
- ~cwd ~desc: Bsb_build_schemas. refmt str)
179
+ (fst ( Bsb_build_util. resolve_bsb_magic_file
180
+ ~cwd ~desc: Bsb_build_schemas. refmt str))
180
181
| Some config ->
181
182
Bsb_exception. config_error config " expect version 2 or 3"
182
183
| None ->
@@ -189,11 +190,11 @@ let interpret_json
189
190
Some { path =
190
191
match String_map. find_opt obj Bsb_build_schemas. path with
191
192
| None ->
192
- Bsb_build_util. resolve_bsb_magic_file
193
+ fst @@ Bsb_build_util. resolve_bsb_magic_file
193
194
~cwd ~desc: " gentype.exe"
194
195
" gentype/gentype.exe"
195
196
| Some (Str {str} ) ->
196
- Bsb_build_util. resolve_bsb_magic_file
197
+ fst @@ Bsb_build_util. resolve_bsb_magic_file
197
198
~cwd ~desc: " gentype.exe" str
198
199
| Some config ->
199
200
Bsb_exception. config_error config
@@ -264,7 +265,7 @@ let interpret_json
264
265
| Some (Str {str = p } ) ->
265
266
if p = " " then failwith " invalid pp, empty string found"
266
267
else
267
- Some (Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. pp_flags p)
268
+ Some (fst @@ Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. pp_flags p)
268
269
| Some x ->
269
270
Bsb_exception. errorf ~loc: (Ext_json. loc_of x) " pp-flags expected a string"
270
271
| None ->
@@ -294,7 +295,7 @@ let interpret_json
294
295
295
296
|? (Bsb_build_schemas. js_post_build, `Obj begin fun m ->
296
297
m |? (Bsb_build_schemas. cmd , `Str (fun s ->
297
- js_post_build_cmd := Some (Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. js_post_build s)
298
+ js_post_build_cmd := Some (fst @@ Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. js_post_build s)
298
299
299
300
)
300
301
)
@@ -313,10 +314,18 @@ let interpret_json
313
314
|? (Bsb_build_schemas. bs_external_includes, `Arr (fun s -> bs_external_includes := get_list_string s))
314
315
|? (Bsb_build_schemas. bsc_flags, `Arr (fun s -> bsc_flags := Bsb_build_util. get_list_string_acc s ! bsc_flags))
315
316
|? (Bsb_build_schemas. ppx_flags, `Arr (fun s ->
316
- ppx_flags := Ext_list. map (get_list_string s) (fun p ->
317
+ let args = get_list_string s in
318
+ let a,b = Ext_list. map_split_opt args (fun p ->
317
319
if p = " " then failwith " invalid ppx, empty string found"
318
- else Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. ppx_flags p
319
- )
320
+ else
321
+ let file, checked =
322
+ Bsb_build_util. resolve_bsb_magic_file ~cwd ~desc: Bsb_build_schemas. ppx_flags p
323
+ in
324
+ let some_file = Some file in
325
+ some_file, if checked then some_file else None
326
+ ) in
327
+ ppx_files := a ;
328
+ ppx_checked_files := b
320
329
))
321
330
322
331
|? (Bsb_build_schemas. cut_generators, `Bool (fun b -> cut_generators := b))
@@ -385,8 +394,9 @@ let interpret_json
385
394
warning = warning;
386
395
external_includes = ! bs_external_includes;
387
396
bsc_flags = ! bsc_flags ;
388
- ppx_flags = ! ppx_flags ;
389
- pp_flags = pp_flags ;
397
+ ppx_files = ! ppx_files ;
398
+ ppx_checked_files = ! ppx_checked_files;
399
+ pp_file = pp_flags ;
390
400
bs_dependencies = ! bs_dependencies;
391
401
bs_dev_dependencies = ! bs_dev_dependencies;
392
402
refmt;
0 commit comments