-
Notifications
You must be signed in to change notification settings - Fork 392
/
package.mli
194 lines (133 loc) · 3.76 KB
/
package.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
(** Information about a package defined in the workspace *)
open Import
module Name : sig
type t = Dune_lang.Package_name.t
val opam_fn : t -> string
val version_fn : t -> string
include module type of Dune_lang.Package_name with type t := t
val of_opam_file_basename : string -> t option
val of_opam_package_name : OpamTypes.name -> t
val to_opam_package_name : t -> OpamTypes.name
module Map_traversals : sig
val parallel_iter : 'a Map.t -> f:(t -> 'a -> unit Memo.t) -> unit Memo.t
val parallel_map : 'a Map.t -> f:(t -> 'a -> 'b Memo.t) -> 'b Map.t Memo.t
end
end
module Id : sig
type t
val name : t -> Name.t
include Comparable_intf.S with type key := t
end
module Dependency : sig
module Op : sig
type t =
| Eq
| Gte
| Lte
| Gt
| Lt
| Neq
val to_relop : t -> OpamParserTypes.FullPos.relop
end
module Constraint : sig
module Var : sig
type t =
| Literal of string
(** A quoted string literal, such as a version number *)
| Var of string (** A variable name such as :version or :with-test *)
end
type t =
| Bvar of Var.t
| Uop of Op.t * Var.t
| Bop of Op.t * Var.t * Var.t
| And of t list
| Or of t list
val to_dyn : t -> Dyn.t
end
type t =
{ name : Name.t
; constraint_ : Constraint.t option
}
val opam_depend : t -> OpamParserTypes.FullPos.value
val to_dyn : t -> Dyn.t
val decode : t Dune_lang.Decoder.t
end
module Source_kind : sig
module Host : sig
type kind =
| Github
| Bitbucket
| Gitlab
| Sourcehut
type t =
{ user : string
; repo : string
; kind : kind
}
val homepage : t -> string
end
type t =
| Host of Host.t
| Url of string
val to_dyn : t Dyn.builder
val to_string : t -> string
val decode : t Dune_lang.Decoder.t
end
module Info : sig
type t
val source : t -> Source_kind.t option
val license : t -> string list option
val authors : t -> string list option
val homepage : t -> string option
val bug_reports : t -> string option
val documentation : t -> string option
val maintainers : t -> string list option
(** example package info (used for project initialization ) *)
val example : t
val empty : t
val to_dyn : t Dyn.builder
val encode_fields : t -> Dune_lang.t list
val decode :
?since:Dune_lang.Syntax.Version.t
-> unit
-> t Dune_lang.Decoder.fields_parser
val superpose : t -> t -> t
end
type opam_file =
| Exists of bool
| Generated
type t =
{ id : Id.t
; opam_file : Path.Source.t
; loc : Loc.t
; synopsis : string option
; description : string option
; depends : Dependency.t list
; conflicts : Dependency.t list
; depopts : Dependency.t list
; info : Info.t
; version : string option
; has_opam_file : opam_file
; tags : string list
; deprecated_package_names : Loc.t Name.Map.t
; sites : Section.t Section.Site.Map.t
; allow_empty : bool
}
val equal : t -> t -> bool
val name : t -> Name.t
val dir : t -> Path.Source.t
val set_inside_opam_dir : t -> dir:Path.Source.t -> t
val file : dir:Path.t -> name:Name.t -> Path.t
val encode : Name.t -> t Dune_lang.Encoder.t
val decode : dir:Path.Source.t -> t Dune_lang.Decoder.t
val opam_file : t -> Path.Source.t
val meta_file : t -> Path.Source.t
val deprecated_meta_file : t -> Name.t -> Path.Source.t
val to_dyn : t -> Dyn.t
val hash : t -> int
val is_opam_file : Path.t -> bool
(** Construct a default package (e.g., for project initialization) *)
val default : Name.t -> Path.Source.t -> t
(** Construct a package description from an opam file. *)
val load_opam_file : Path.Source.t -> Name.t -> t Memo.t
val missing_deps : t -> effective_deps:Name.Set.t -> Name.Set.t