-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The command `dune ocaml doc` will now lock, build, and run odoc as a dev tool if the dev tools feature is enabled. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
- Loading branch information
Showing
14 changed files
with
394 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
open! Import | ||
|
||
val is_enabled : bool Lazy.t | ||
val lock_ocamlformat : unit -> unit Fiber.t | ||
val lock_ocamlformat : unit -> unit Memo.t | ||
val lock_odoc : unit -> unit Memo.t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,42 @@ | ||
open! Import | ||
|
||
type t = Ocamlformat | ||
type t = | ||
| Ocamlformat | ||
| Odoc | ||
|
||
let all = [ Ocamlformat ] | ||
let all = [ Ocamlformat; Odoc ] | ||
|
||
let equal a b = | ||
match a, b with | ||
| Ocamlformat, Ocamlformat -> true | ||
| Odoc, Odoc -> true | ||
| _ -> false | ||
;; | ||
|
||
let package_name = function | ||
| Ocamlformat -> Package_name.of_string "ocamlformat" | ||
| Odoc -> Package_name.of_string "odoc" | ||
;; | ||
|
||
let of_package_name package_name = | ||
match Package_name.to_string package_name with | ||
| "ocamlformat" -> Ocamlformat | ||
| "odoc" -> Odoc | ||
| other -> User_error.raise [ Pp.textf "No such dev tool: %s" other ] | ||
;; | ||
|
||
let exe_name = function | ||
| Ocamlformat -> "ocamlformat" | ||
| Odoc -> "odoc" | ||
;; | ||
|
||
let exe_path_components_within_package t = | ||
match t with | ||
| Ocamlformat -> [ "bin"; exe_name t ] | ||
| Odoc -> [ "bin"; exe_name t ] | ||
;; | ||
|
||
let needs_to_build_with_same_compiler_as_project = function | ||
| Ocamlformat -> false | ||
| Odoc -> true | ||
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.