Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move odoc priv rules to lib_rules #10161

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading