Skip to content

Commit

Permalink
refactor: move odoc priv rules to lib_rules (#10161)
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Chávarri <javier.chavarri@gmail.com>
  • Loading branch information
jchavarri authored Feb 28, 2024
1 parent ce5c9ca commit b9f2600
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/dune_rules/gen_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ end = struct
let* enabled_if = Lib.DB.available (Scope.libs scope) (Library.best_name lib) in
if_available_buildable
~loc:lib.buildable.loc
(fun () ->
let+ () = Odoc.setup_private_library_doc_alias sctx ~scope ~dir:ctx_dir lib
and+ rules = Lib_rules.rules lib ~sctx ~dir ~scope ~dir_contents ~expander in
rules)
(fun () -> Lib_rules.rules lib ~sctx ~dir ~scope ~dir_contents ~expander)
enabled_if
| Foreign.Library.T lib ->
Expander.eval_blang expander lib.enabled_if
Expand Down
11 changes: 10 additions & 1 deletion src/dune_rules/lib_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ let library_rules
~source_modules
~dir_contents
~compile_info
~ctx_dir
=
let source_modules =
Modules.fold_user_written source_modules ~init:[] ~f:(fun m acc -> m :: acc)
Expand Down Expand Up @@ -607,6 +608,7 @@ let library_rules
~requires:requires_compile
~dir_contents
~vlib_stubs_o_files)
and+ () = Odoc.setup_private_library_doc_alias sctx ~scope ~dir:ctx_dir lib
and+ () = Odoc.setup_library_odoc_rules cctx local_lib
and+ () =
Sub_system.gen_rules
Expand Down Expand Up @@ -648,7 +650,14 @@ let rules (lib : Library.t) ~sctx ~dir_contents ~dir ~expander ~scope =
| Some _ ->
Ctypes_rules.gen_rules ~loc:(fst lib.name) ~cctx ~buildable ~sctx ~scope ~dir
in
library_rules lib ~local_lib ~cctx ~source_modules ~dir_contents ~compile_info
library_rules
lib
~local_lib
~cctx
~source_modules
~dir_contents
~compile_info
~ctx_dir:dir
in
let* () = Buildable_rules.gen_select_rules sctx compile_info ~dir in
Buildable_rules.with_lib_deps (Super_context.context sctx) compile_info ~dir ~f
Expand Down

0 comments on commit b9f2600

Please sign in to comment.