dune/src/package.ml

27 lines
563 B
OCaml
Raw Normal View History

open Stdune
2018-03-02 18:44:03 +00:00
module Name = struct
include Interned.Make(struct
let initial_size = 16
let resize_policy = Interned.Conservative
let order = Interned.Natural
end)()
2018-03-02 18:44:03 +00:00
2018-03-03 13:41:29 +00:00
let of_string = make
2018-03-02 18:44:03 +00:00
2018-03-03 13:41:29 +00:00
let opam_fn (t : t) = to_string t ^ ".opam"
2018-03-02 18:44:03 +00:00
2018-03-03 13:41:29 +00:00
let pp fmt t = Format.pp_print_string fmt (to_string t)
let t = Sexp.Of_sexp.(map string ~f:of_string)
2018-03-02 18:44:03 +00:00
end
2017-02-24 18:21:22 +00:00
type t =
2018-03-02 18:44:03 +00:00
{ name : Name.t
2017-02-24 18:21:22 +00:00
; path : Path.t
; version_from_opam_file : string option
}
2018-03-02 18:44:03 +00:00
let opam_file t = Path.relative t.path (Name.opam_fn t.name)