forked from facebook/flow
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdune
More file actions
35 lines (30 loc) · 972 Bytes
/
dune
File metadata and controls
35 lines (30 loc) · 972 Bytes
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
(* -*- tuareg -*- *)
let library_entry name suffix =
Printf.sprintf
"(library
(name %s)
(wrapped false)
(modules)
(libraries %s_%s))" name name suffix
let fb_entry name =
library_entry name "fb"
let stubs_entry name =
library_entry name "stubs"
let entry is_fb name =
if is_fb then
fb_entry name
else
stubs_entry name
let () =
(* test presence of fb subfolder *)
let current_dir = Sys.getcwd () in
(* we are in src/logging/, locate src/facebook *)
let src_dir = Filename.dirname current_dir in
let fb_dir = Filename.concat src_dir "facebook" in
(* locate src/facebook/dune *)
let fb_dune = Filename.concat fb_dir "dune" in
let is_fb = Sys.file_exists fb_dune in
let logging = entry is_fb "flow_logging" in
let logging_lwt = entry is_fb "logging_common_lwt" in
let interaction_logging = entry is_fb "flow_interaction_logging" in
Jbuild_plugin.V1.send (String.concat "\n\n" [logging; logging_lwt; interaction_logging])