Skip to content

Commit

Permalink
Change deprecated modules in a separate directory
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
  • Loading branch information
rgrinberg committed Aug 31, 2018
1 parent 5788aff commit acf9446
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ let deprecate t =
| Some intf, _ -> intf.path
| None, None -> assert false
in
let path =
Path.L.relative (Path.parent_exn path)
[ ".deprecated"
; Path.basename path
]
in
let (base, _) = Path.split_extension path in
{ syntax = OCaml
; path = Path.extend_basename base ~suffix:".ml-gen"
Expand Down
5 changes: 5 additions & 0 deletions src/stdune/path.ml
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,8 @@ module Internal = struct
| In_source_tree l -> Local l
| External l -> External l
end

module L = struct
(* TODO more efficient implementation *)
let relative t = List.fold_left ~init:t ~f:relative
end
4 changes: 4 additions & 0 deletions src/stdune/path.mli
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,7 @@ val set_root : External.t -> unit
module Internal : sig
val raw_kind : t -> Kind.t
end

module L : sig
val relative : t -> string list -> t
end

0 comments on commit acf9446

Please sign in to comment.