summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-01-10 03:50:28 +0700
committerDaniil Baturin <daniil@baturin.org>2017-01-10 03:50:28 +0700
commitf947b3e8e7b9db2fcab250ce6d8050b650130cec (patch)
tree3f69a45fa9336c1c8a743c3080c6656ac19a5e2b
parent6cb2c8f1c67532f1f3a23e75b80984d40ed160d2 (diff)
downloadvyconf-f947b3e8e7b9db2fcab250ce6d8050b650130cec.tar.gz
vyconf-f947b3e8e7b9db2fcab250ce6d8050b650130cec.zip
Add JSON de/serialization derivers to vytree and config tree modules.
-rw-r--r--_oasis14
-rw-r--r--_tags18
-rw-r--r--setup.ml39
-rw-r--r--src/config_tree.ml4
-rw-r--r--src/config_tree.mli4
-rw-r--r--src/vytree.ml2
-rw-r--r--src/vytree.mli2
7 files changed, 61 insertions, 22 deletions
diff --git a/_oasis b/_oasis
index 731b0cc..da6060e 100644
--- a/_oasis
+++ b/_oasis
@@ -20,6 +20,7 @@ Library "vytree"
Path: src
Modules: Vytree
FindlibParent: vyconf
+ BuildDepends: ppx_deriving_yojson
Library "reference_tree"
Path: src
@@ -31,6 +32,7 @@ Library "config_tree"
Path: src
Modules: Config_tree
FindlibParent: vyconf
+ BuildDepends: ppx_deriving_yojson
Library "value_checker"
Path: src
@@ -95,7 +97,7 @@ Executable "vytree_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: oUnit, vyconf
+ BuildDepends: oUnit, ppx_deriving.runtime, ppx_deriving_yojson.runtime, vyconf
Executable "reference_tree_test"
Path: test
@@ -103,7 +105,7 @@ Executable "reference_tree_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: oUnit, xml-light, pcre, vyconf
+ BuildDepends: oUnit, ppx_deriving.runtime, ppx_deriving_yojson.runtime, xml-light, pcre, vyconf
Executable "config_tree_test"
Path: test
@@ -111,7 +113,7 @@ Executable "config_tree_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: oUnit, vyconf
+ BuildDepends: oUnit, ppx_deriving.runtime, ppx_deriving_yojson.runtime, vyconf
Executable "vylist_test"
Path: test
@@ -151,7 +153,7 @@ Executable "curly_parser_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: oUnit, vyconf
+ BuildDepends: oUnit, ppx_deriving.runtime, ppx_deriving_yojson.runtime, vyconf
Executable "session_test"
Path: test
@@ -159,7 +161,7 @@ Executable "session_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: oUnit, vyconf, xml-light, fileutils, pcre
+ BuildDepends: oUnit, ppx_deriving.runtime, ppx_deriving_yojson.runtime, xml-light, fileutils, pcre, vyconf
Executable "vytree_load_test"
Path: test
@@ -167,7 +169,7 @@ Executable "vytree_load_test"
Build$: flag(tests)
CompiledObject: best
Install: false
- BuildDepends: vyconf
+ BuildDepends: ppx_deriving.runtime, ppx_deriving_yojson.runtime, vyconf
Test "vytree_test"
Run$: flag(tests)
diff --git a/_tags b/_tags
index 9625c6f..cdc2d08 100644
--- a/_tags
+++ b/_tags
@@ -1,5 +1,5 @@
# OASIS_START
-# DO NOT EDIT (digest: adbc5f656e7c012d33ba25a4cb9be2ac)
+# DO NOT EDIT (digest: 0757c9ec9f5d35df060616ca6806b8dd)
# Ignore VCS directories, you can use the same kind of rule outside
# OASIS_START/STOP if you want to exclude directories that contains
# useless stuff for the build process
@@ -22,6 +22,7 @@ true: annot, bin_annot
"src/reference_tree.cmxs": use_reference_tree
# Library config_tree
"src/config_tree.cmxs": use_config_tree
+<src/*.ml{,i,y}>: pkg_ppx_deriving_yojson
# Library value_checker
"src/value_checker.cmxs": use_value_checker
<src/*.ml{,i,y}>: pkg_pcre
@@ -64,14 +65,20 @@ true: annot, bin_annot
<src/*.ml{,i,y}>: use_vyconf
# Executable vytree_test
<test/vytree_test.{native,byte}>: pkg_oUnit
+<test/vytree_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/vytree_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/vytree_test.{native,byte}>: use_vyconf
# Executable reference_tree_test
<test/reference_tree_test.{native,byte}>: pkg_oUnit
<test/reference_tree_test.{native,byte}>: pkg_pcre
+<test/reference_tree_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/reference_tree_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/reference_tree_test.{native,byte}>: pkg_xml-light
<test/reference_tree_test.{native,byte}>: use_vyconf
# Executable config_tree_test
<test/config_tree_test.{native,byte}>: pkg_oUnit
+<test/config_tree_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/config_tree_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/config_tree_test.{native,byte}>: use_vyconf
# Executable vylist_test
<test/vylist_test.{native,byte}>: pkg_oUnit
@@ -89,15 +96,18 @@ true: annot, bin_annot
<test/vyconf_config_test.{native,byte}>: pkg_ppx_deriving.runtime
<test/vyconf_config_test.{native,byte}>: pkg_toml
<test/vyconf_config_test.{native,byte}>: use_vyconf
-<test/*.ml{,i,y}>: pkg_ppx_deriving.runtime
<test/*.ml{,i,y}>: pkg_toml
# Executable curly_parser_test
<test/curly_parser_test.{native,byte}>: pkg_oUnit
+<test/curly_parser_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/curly_parser_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/curly_parser_test.{native,byte}>: use_vyconf
# Executable session_test
<test/session_test.{native,byte}>: pkg_fileutils
<test/session_test.{native,byte}>: pkg_oUnit
<test/session_test.{native,byte}>: pkg_pcre
+<test/session_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/session_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/session_test.{native,byte}>: pkg_xml-light
<test/session_test.{native,byte}>: use_vyconf
<test/*.ml{,i,y}>: pkg_fileutils
@@ -105,7 +115,11 @@ true: annot, bin_annot
<test/*.ml{,i,y}>: pkg_pcre
<test/*.ml{,i,y}>: pkg_xml-light
# Executable vytree_load_test
+<test/vytree_load_test.{native,byte}>: pkg_ppx_deriving.runtime
+<test/vytree_load_test.{native,byte}>: pkg_ppx_deriving_yojson.runtime
<test/vytree_load_test.{native,byte}>: use_vyconf
+<test/*.ml{,i,y}>: pkg_ppx_deriving.runtime
+<test/*.ml{,i,y}>: pkg_ppx_deriving_yojson.runtime
<test/*.ml{,i,y}>: use_vyconf
# OASIS_STOP
diff --git a/setup.ml b/setup.ml
index a42fdf7..67ff1be 100644
--- a/setup.ml
+++ b/setup.ml
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.4.8 *)
(* OASIS_START *)
-(* DO NOT EDIT (digest: 044bf0771190034a61f341e0b3430b49) *)
+(* DO NOT EDIT (digest: 84b1c61979038af9d47810eec03f5beb) *)
(*
Regenerated by OASIS v0.4.8
Visit http://oasis.forge.ocamlcore.org for more information and
@@ -7400,7 +7400,8 @@ let setup_t =
bs_install = [(OASISExpr.EBool true, true)];
bs_path = "src";
bs_compiled_object = Best;
- bs_build_depends = [];
+ bs_build_depends =
+ [FindlibPackage ("ppx_deriving_yojson", None)];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_interface_patterns =
[
@@ -7688,7 +7689,8 @@ let setup_t =
bs_install = [(OASISExpr.EBool true, true)];
bs_path = "src";
bs_compiled_object = Best;
- bs_build_depends = [];
+ bs_build_depends =
+ [FindlibPackage ("ppx_deriving_yojson", None)];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_interface_patterns =
[
@@ -9270,6 +9272,9 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("oUnit", None);
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
InternalLibrary "vyconf"
];
bs_build_tools = [ExternalTool "ocamlbuild"];
@@ -9412,6 +9417,9 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("oUnit", None);
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
FindlibPackage ("xml-light", None);
FindlibPackage ("pcre", None);
InternalLibrary "vyconf"
@@ -9559,6 +9567,9 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("oUnit", None);
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
InternalLibrary "vyconf"
];
bs_build_tools = [ExternalTool "ocamlbuild"];
@@ -10280,6 +10291,9 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("oUnit", None);
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
InternalLibrary "vyconf"
];
bs_build_tools = [ExternalTool "ocamlbuild"];
@@ -10425,10 +10439,13 @@ let setup_t =
bs_build_depends =
[
FindlibPackage ("oUnit", None);
- InternalLibrary "vyconf";
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
FindlibPackage ("xml-light", None);
FindlibPackage ("fileutils", None);
- FindlibPackage ("pcre", None)
+ FindlibPackage ("pcre", None);
+ InternalLibrary "vyconf"
];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_interface_patterns =
@@ -10567,7 +10584,13 @@ let setup_t =
bs_install = [(OASISExpr.EBool true, false)];
bs_path = "test";
bs_compiled_object = Best;
- bs_build_depends = [InternalLibrary "vyconf"];
+ bs_build_depends =
+ [
+ FindlibPackage ("ppx_deriving.runtime", None);
+ FindlibPackage
+ ("ppx_deriving_yojson.runtime", None);
+ InternalLibrary "vyconf"
+ ];
bs_build_tools = [ExternalTool "ocamlbuild"];
bs_interface_patterns =
[
@@ -11013,7 +11036,7 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.8";
- oasis_digest = Some "\141\001l_\201\176\019\146o0\181\221d\139\016\029";
+ oasis_digest = Some "\027{n\2259\249cpP<\136\011\130\144}u";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
@@ -11021,7 +11044,7 @@ let setup_t =
let setup () = BaseSetup.setup setup_t;;
-# 11025 "setup.ml"
+# 11048 "setup.ml"
let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t
open BaseCompat.Compat_0_4
(* OASIS_STOP *)
diff --git a/src/config_tree.ml b/src/config_tree.ml
index f99c737..538b258 100644
--- a/src/config_tree.ml
+++ b/src/config_tree.ml
@@ -10,9 +10,9 @@ type config_node_data = {
comment: string option;
inactive: bool;
ephemeral: bool;
-}
+} [@@deriving yojson]
-type t = config_node_data Vytree.t
+type t = config_node_data Vytree.t [@@deriving yojson]
let default_data = {
values = [];
diff --git a/src/config_tree.mli b/src/config_tree.mli
index 2c463cb..4da734e 100644
--- a/src/config_tree.mli
+++ b/src/config_tree.mli
@@ -8,9 +8,9 @@ type config_node_data = {
comment : string option;
inactive : bool;
ephemeral : bool;
-}
+} [@@deriving yojson]
-type t = config_node_data Vytree.t
+type t = config_node_data Vytree.t [@@deriving yojson]
val default_data : config_node_data
diff --git a/src/vytree.ml b/src/vytree.ml
index b27aea6..74dbe45 100644
--- a/src/vytree.ml
+++ b/src/vytree.ml
@@ -2,7 +2,7 @@ type 'a t = {
name: string;
data: 'a;
children: 'a t list
-}
+} [@@deriving yojson]
type position = Before of string | After of string | End | Default
diff --git a/src/vytree.mli b/src/vytree.mli
index d00d3ff..02d8edf 100644
--- a/src/vytree.mli
+++ b/src/vytree.mli
@@ -1,4 +1,4 @@
-type 'a t
+type 'a t [@@deriving yojson]
exception Empty_path
exception Duplicate_child