Skip to content

Commit fcbbcd6

Browse files
committed
move generic map/table atd bindings into common.atd file
The bindings should be usable by any file, not just state.atd
1 parent 6e5c4cc commit fcbbcd6

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

lib/common.atd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
type 'v map_as_object =
2+
(string * 'v) list <json repr="object">
3+
wrap <ocaml module="Common.StringMap" t="'v Common.StringMap.t">
4+
5+
type 'v table_as_object =
6+
(string * 'v) list <json repr="object">
7+
wrap <ocaml module="Common.Table" t="'v Common.Table.t">

lib/dune

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@
66
(preprocess
77
(pps lwt_ppx)))
88

9+
(rule
10+
(targets common_t.ml common_t.mli)
11+
(deps common.atd)
12+
(action
13+
(run atdgen -t %{deps})))
14+
15+
(rule
16+
(targets common_j.ml common_j.mli)
17+
(deps common.atd)
18+
(action
19+
(run atdgen -j -j-std %{deps})))
20+
921
(rule
1022
(targets github_t.ml github_t.mli)
1123
(deps github.atd)

lib/state.atd

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
type config <ocaml from="Config"> = abstract
22
type status_state <ocaml from="Github"> = abstract
3-
4-
type 'v map_as_object =
5-
(string * 'v) list <json repr="object">
6-
wrap <ocaml module="Common.StringMap" t="'v Common.StringMap.t">
7-
8-
type 'v table_as_object =
9-
(string * 'v) list <json repr="object">
10-
wrap <ocaml module="Common.Table" t="'v Common.Table.t">
3+
type 'v map_as_object <ocaml from="Common"> = abstract
4+
type 'v table_as_object <ocaml from="Common"> = abstract
115

126
(* A map from branch names to build statuses *)
137
type branch_statuses = status_state map_as_object

0 commit comments

Comments
 (0)