Skip to content

Commit

Permalink
Add depopts field
Browse files Browse the repository at this point in the history
The depopts is just like the conflicts and depends fields

Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg committed May 1, 2019
1 parent aeb8f4a commit 1540306
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/dune_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ let package_decode ~dir =
field ~default:[] "depends" (repeat Package.Dependency.decode)
and+ conflicts =
field ~default:[] "conflicts" (repeat Package.Dependency.decode)
and+ depopts =
field ~default:[] "depopts" (repeat Package.Dependency.decode)
and+ opam = field_o "opam" Package.Opam.decode
in
{ Package.
Expand All @@ -563,6 +565,7 @@ let package_decode ~dir =
; description
; depends
; conflicts
; depopts
; path = dir
; version_from_opam_file = None
; kind = Dune false
Expand Down Expand Up @@ -726,6 +729,7 @@ let load ~dir ~files =
; version_from_opam_file
; conflicts = []
; depends = []
; depopts = []
; synopsis = None
; description = None
; kind = Opam
Expand Down
5 changes: 4 additions & 1 deletion src/opam_create.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ let correct_specific
; description
; depends
; conflicts
; depopts
; name = _
; path = _
; version_from_opam_file = _
Expand All @@ -17,7 +18,9 @@ let correct_specific
list depends
(set_list "depends" Package.Dependency.opam_depend) >>>
list conflicts
(set_list "conflicts" Package.Dependency.opam_depend)
(set_list "conflicts" Package.Dependency.opam_depend) >>>
list depopts
(set_list "depopts" Package.Dependency.opam_depend)

let correct project (package : Package.t)=
let open Opam_file.Mutator in
Expand Down
6 changes: 5 additions & 1 deletion src/package.ml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ type t =
; description : string option
; depends : Dependency.t list
; conflicts : Dependency.t list
; depopts : Dependency.t list
; path : Path.Source.t
; version_from_opam_file : string option
; kind : Kind.t
Expand All @@ -245,6 +246,7 @@ let hash { name
; description
; depends
; conflicts
; depopts
; path
; version_from_opam_file
; kind
Expand All @@ -256,14 +258,15 @@ let hash { name
, Option.hash String.hash description
, List.hash Dependency.hash depends
, List.hash Dependency.hash conflicts
, List.hash Dependency.hash depopts
, Path.Source.hash path
, Option.hash String.hash version_from_opam_file
, Kind.hash kind
, Option.hash Opam.hash opam
)

let to_dyn { name; path; version_from_opam_file ; synopsis ; description
; depends ; conflicts ; kind ; opam } =
; depends ; conflicts ; depopts ; kind ; opam } =
let open Dyn.Encoder in
record
[ "name", Name.to_dyn name
Expand All @@ -274,6 +277,7 @@ let to_dyn { name; path; version_from_opam_file ; synopsis ; description
; "description", option string description
; "depends", list Dependency.to_dyn depends
; "conflicts", list Dependency.to_dyn conflicts
; "depopts", list Dependency.to_dyn depopts
; "kind", Kind.to_dyn kind
; "opam", option Opam.to_dyn opam
]
Expand Down
1 change: 1 addition & 0 deletions src/package.mli
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type t =
; description : string option
; depends : Dependency.t list
; conflicts : Dependency.t list
; depopts : Dependency.t list
; path : Path.Source.t
; version_from_opam_file : string option
; kind : Kind.t
Expand Down

0 comments on commit 1540306

Please sign in to comment.