forked from ocaml/dune
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjbuild.mli
240 lines (200 loc) · 5.33 KB
/
jbuild.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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
(** Representation and parsing of jbuild files *)
open Import
module Jbuild_version : sig
type t = V1
val t : t Sexp.Of_sexp.t
val latest_stable : t
end
module Scope : sig
type t =
{ name : string option (** First package name in alphabetical order. [None] for
the global scope. *)
; packages : Package.t String_map.t
; root : Path.t
}
val make : Package.t list -> t
val empty : t
val resolve : t -> string -> (Package.t, string) result
end
(** Ppx preprocessors *)
module Pp : sig
type t
val of_string : string -> t
val to_string : t -> string
end
module Preprocess : sig
type pps =
{ pps : Pp.t list
; flags : string list
}
type t =
| No_preprocessing
| Action of Action.Unexpanded.t
| Pps of pps
end
module Preprocess_map : sig
type t
val no_preprocessing : t
val default : t
(** [find module_name] find the preprocessing specification for a given module *)
val find : string -> t -> Preprocess.t
val pps : t -> Pp.t list
end
module Js_of_ocaml : sig
type t =
{ flags : Ordered_set_lang.Unexpanded.t
; javascript_files : string list
}
val default : t
end
module Lib_dep : sig
type choice =
{ required : String_set.t
; forbidden : String_set.t
; file : string
}
type select =
{ result_fn : string
; choices : choice list
; loc : Loc.t
}
type t =
| Direct of string
| Select of select
val to_lib_names : t -> string list
val direct : string -> t
end
module Lib_deps : sig
type t = Lib_dep.t list
end
module Dep_conf : sig
type t =
| File of String_with_vars.t
| Alias of String_with_vars.t
| Glob_files of String_with_vars.t
| Files_recursively_in of String_with_vars.t
val sexp_of_t : t -> Sexp.t
end
module Buildable : sig
type t =
{ modules : Ordered_set_lang.t
; libraries : Lib_dep.t list
; preprocess : Preprocess_map.t
; preprocessor_deps : Dep_conf.t list
; flags : Ordered_set_lang.Unexpanded.t
; ocamlc_flags : Ordered_set_lang.Unexpanded.t
; ocamlopt_flags : Ordered_set_lang.Unexpanded.t
; js_of_ocaml : Js_of_ocaml.t
}
(** Preprocessing specification used by all modules or [No_preprocessing] *)
val single_preprocess : t -> Preprocess.t
end
module Public_lib : sig
type t =
{ name : string (** Full public name *)
; package : Package.t (** Package it is part of *)
; sub_dir : string option (** Subdirectory inside the installation directory *)
}
end
module Library : sig
module Kind : sig
type t =
| Normal
| Ppx_deriver
| Ppx_rewriter
end
type t =
{ name : string
; public : Public_lib.t option
; synopsis : string option
; install_c_headers : string list
; ppx_runtime_libraries : string list
; modes : Mode.Dict.Set.t
; kind : Kind.t
; c_flags : Ordered_set_lang.Unexpanded.t
; c_names : string list
; cxx_flags : Ordered_set_lang.Unexpanded.t
; cxx_names : string list
; library_flags : Ordered_set_lang.Unexpanded.t
; c_library_flags : Ordered_set_lang.Unexpanded.t
; self_build_stubs_archive : string option
; virtual_deps : string list
; wrapped : bool
; optional : bool
; buildable : Buildable.t
; dynlink : bool
}
val has_stubs : t -> bool
val stubs_archive : t -> dir:Path.t -> ext_lib:string -> Path.t
val all_lib_deps : t -> Lib_deps.t
end
module Install_conf : sig
type file =
{ src : string
; dst : string option
}
type t =
{ section : Install.Section.t
; files : file list
; package : Package.t
}
end
module Executables : sig
type t =
{ names : string list
; link_executables : bool
; link_flags : Ordered_set_lang.Unexpanded.t
; modes : Mode.Dict.Set.t
; buildable : Buildable.t
}
end
module Rule : sig
module Targets : sig
type t =
| Static of string list
| Infer
end
module Fallback : sig
type t =
| Yes
| No
| Not_possible
(** It is not possible to add a [(fallback)] field to the rule. For instance for
[ocamllex], ... *)
end
type t =
{ targets : Targets.t
; deps : Dep_conf.t list
; action : Action.Unexpanded.t
; fallback : Fallback.t
; loc : Loc.t
}
end
module Provides : sig
type t =
{ name : string
; file : string
}
end
module Alias_conf : sig
type t =
{ name : string
; deps : Dep_conf.t list
; action : Action.Unexpanded.t option
; package : Package.t option
}
end
module Stanza : sig
type t =
| Library of Library.t
| Executables of Executables.t
| Rule of Rule.t
| Provides of Provides.t
| Install of Install_conf.t
| Alias of Alias_conf.t
end
module Stanzas : sig
type t = Stanza.t list
val parse : Scope.t -> Sexp.Ast.t list -> t
val lib_names : (_ * _ * t) list -> String_set.t
end