From ff4a0f824b33dfce8010d0ba4a6075369bbfec94 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 17 Jan 2017 20:17:21 +0700 Subject: Second act of the _oasis cleanup. Findlib package "vyconf" now contains modules required for working with configs, namely Vytree, Config_tree, Reference_tree, Valur_checker, Curly_lexer, and Curly_parser. Renderer will go there too. Migration scripts and convertors/analyzers/whatever utilities that need to read and write config files will link with it. The "vyconf.vyconf-config" package is for working with vyconfd.conf config. Config scripts written in OCaml, the shell, and the non-interactive client can use it to read the system config if the user didn't use options for socket location and so on. The "vyconf.vyconf-client" package is for the Protobuf over UNIX sockets protocol clients. --- _oasis | 36 +++++---- _tags | 58 +++++++++++++-- myocamlbuild.ml | 10 ++- setup.ml | 224 +++++++++++++++++++++++++++++++++++++++++++++----------- 4 files changed, 262 insertions(+), 66 deletions(-) diff --git a/_oasis b/_oasis index 65bdd4c..55a8575 100644 --- a/_oasis +++ b/_oasis @@ -13,20 +13,28 @@ Plugins: META (0.4), DevFiles (0.4) Library "vyconf" Path: src - Modules: Config_tree, Reference_tree, Curly_parser, Curly_lexer - InternalModules: Defaults, Directories, Startup, Util, Value_checker, Vylist, Vytree + Modules: Config_tree, Reference_tree, Curly_parser, Curly_lexer, Value_checker, Vytree + InternalModules: Util, Vylist + BuildDepends: fileutils, pcre, ppx_deriving.show, ppx_deriving_yojson, xml-light + +Library "vyconf-config" + Path: src + Modules: Vyconf_config + FindlibParent: vyconf + BuildDepends: toml, fileutils, ppx_deriving.show Library "vyconf-client" Path: src - Modules: Vyconf_client, Vyconf_config + Modules: Vyconf_client + InternalModules: Vyconf_pb FindlibParent: vyconf + BuildDepends: ocaml-protoc, ocplib-endian Executable "vyconfd" Path: src MainIs: vyconfd.ml CompiledObject: best - BuildDepends: ppx_deriving_yojson, ppx_deriving.show, lwt, lwt.unix, lwt.ppx, pcre, - xml-light, toml, fileutils, ocaml-protoc, ocplib-endian, sha + BuildDepends: lwt, lwt.unix, lwt.ppx, ocaml-protoc, ocplib-endian, sha, vyconf, vyconf.vyconf-config Executable "vytree_test" Path: test @@ -34,7 +42,7 @@ Executable "vytree_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, ppx_deriving_yojson + BuildDepends: oUnit, vyconf Executable "reference_tree_test" Path: test @@ -42,7 +50,7 @@ Executable "reference_tree_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, ppx_deriving_yojson, xml-light, pcre, fileutils + BuildDepends: oUnit, vyconf Executable "config_tree_test" Path: test @@ -50,7 +58,7 @@ Executable "config_tree_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, ppx_deriving_yojson + BuildDepends: oUnit, vyconf Executable "vylist_test" Path: test @@ -66,7 +74,7 @@ Executable "value_checker_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, pcre, fileutils + BuildDepends: oUnit, vyconf Executable "util_test" Path: test @@ -74,7 +82,7 @@ Executable "util_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, vyconf, xml-light, fileutils + BuildDepends: oUnit, vyconf Executable "vyconf_config_test" Path: test @@ -82,7 +90,7 @@ Executable "vyconf_config_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, toml, ppx_deriving.runtime, fileutils + BuildDepends: oUnit, vyconf.vyconf-config Executable "curly_parser_test" Path: test @@ -90,7 +98,7 @@ Executable "curly_parser_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, ppx_deriving_yojson + BuildDepends: oUnit, vyconf Executable "session_test" Path: test @@ -98,7 +106,7 @@ Executable "session_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: oUnit, ppx_deriving_yojson, xml-light, fileutils, pcre, toml + BuildDepends: oUnit, vyconf, vyconf.vyconf-config Executable "vytree_load_test" Path: test @@ -106,7 +114,7 @@ Executable "vytree_load_test" Build$: flag(tests) CompiledObject: best Install: false - BuildDepends: ppx_deriving_yojson + BuildDepends: vyconf Test "vytree_test" Run$: flag(tests) diff --git a/_tags b/_tags index de1fc25..7558d80 100644 --- a/_tags +++ b/_tags @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: 1815d8b26cc41cf7f9f54c73eca4a2f0) +# DO NOT EDIT (digest: 1ac48d02bada81ba62837630375a7522) # 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 @@ -16,6 +16,8 @@ true: annot, bin_annot "_darcs": not_hygienic # Library vyconf "src/vyconf.cmxs": use_vyconf +# Library vyconf-config +"src/vyconf-config.cmxs": use_vyconf-config # Library vyconf-client "src/vyconf-client.cmxs": use_vyconf-client # Executable vyconfd @@ -31,6 +33,8 @@ true: annot, bin_annot : pkg_sha : pkg_toml : pkg_xml-light +: use_vyconf +: use_vyconf-config : pkg_fileutils : pkg_lwt : pkg_lwt.ppx @@ -43,50 +47,90 @@ true: annot, bin_annot : pkg_sha : pkg_toml : pkg_xml-light +: use_vyconf +: use_vyconf-config # Executable vytree_test +: pkg_fileutils : pkg_oUnit +: pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf # Executable reference_tree_test +: pkg_fileutils : pkg_oUnit : pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson : pkg_xml-light +: use_vyconf # Executable config_tree_test +: pkg_fileutils : pkg_oUnit +: pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf # Executable vylist_test : pkg_oUnit # Executable value_checker_test +: pkg_fileutils : pkg_oUnit : pkg_pcre +: pkg_ppx_deriving.show +: pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf # Executable util_test +: pkg_fileutils : pkg_oUnit +: pkg_pcre +: pkg_ppx_deriving.show +: pkg_ppx_deriving_yojson : pkg_xml-light : use_vyconf -: use_vyconf # Executable vyconf_config_test +: pkg_fileutils : pkg_oUnit -: pkg_ppx_deriving.runtime +: pkg_ppx_deriving.show : pkg_toml -: pkg_ppx_deriving.runtime +: use_vyconf-config # Executable curly_parser_test +: pkg_fileutils : pkg_oUnit +: pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf # Executable session_test : pkg_fileutils : pkg_oUnit : pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson : pkg_toml : pkg_xml-light -: pkg_fileutils +: use_vyconf +: use_vyconf-config : pkg_oUnit -: pkg_pcre : pkg_toml -: pkg_xml-light +: use_vyconf-config # Executable vytree_load_test +: pkg_fileutils +: pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf +: pkg_fileutils +: pkg_pcre +: pkg_ppx_deriving.show : pkg_ppx_deriving_yojson +: pkg_xml-light +: use_vyconf # OASIS_STOP true: strict_sequence diff --git a/myocamlbuild.ml b/myocamlbuild.ml index 348c94d..859c97a 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: 57762fb8ab0adc51aba52517380af070) *) +(* DO NOT EDIT (digest: bdb3fd5d41e0b702a74a64a780ae3714) *) module OASISGettext = struct (* # 22 "src/oasis/OASISGettext.ml" *) @@ -886,7 +886,11 @@ open Ocamlbuild_plugin;; let package_default = { MyOCamlbuildBase.lib_ocaml = - [("vyconf", ["src"], []); ("vyconf-client", ["src"], [])]; + [ + ("vyconf", ["src"], []); + ("vyconf-config", ["src"], []); + ("vyconf-client", ["src"], []) + ]; lib_c = []; flags = []; includes = [("test", ["src"])] @@ -897,6 +901,6 @@ let conf = {MyOCamlbuildFindlib.no_automatic_syntax = false} let dispatch_default = MyOCamlbuildBase.dispatch_default conf package_default;; -# 901 "myocamlbuild.ml" +# 905 "myocamlbuild.ml" (* OASIS_STOP *) Ocamlbuild_plugin.dispatch dispatch_default;; diff --git a/setup.ml b/setup.ml index 9ad4120..f9d2b3f 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: 44efe0804e33119cd601d990847fe8ba) *) +(* DO NOT EDIT (digest: f5962643246946021e9baa5b49e05727) *) (* Regenerated by OASIS v0.4.8 Visit http://oasis.forge.ocamlcore.org for more information and @@ -7256,7 +7256,14 @@ let setup_t = bs_install = [(OASISExpr.EBool true, true)]; bs_path = "src"; bs_compiled_object = Best; - bs_build_depends = []; + bs_build_depends = + [ + FindlibPackage ("fileutils", None); + FindlibPackage ("pcre", None); + FindlibPackage ("ppx_deriving.show", None); + FindlibPackage ("ppx_deriving_yojson", None); + FindlibPackage ("xml-light", None) + ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = [ @@ -7384,19 +7391,12 @@ let setup_t = "Config_tree"; "Reference_tree"; "Curly_parser"; - "Curly_lexer" - ]; - lib_pack = false; - lib_internal_modules = - [ - "Defaults"; - "Directories"; - "Startup"; - "Util"; + "Curly_lexer"; "Value_checker"; - "Vylist"; "Vytree" ]; + lib_pack = false; + lib_internal_modules = ["Util"; "Vylist"]; lib_findlib_parent = None; lib_findlib_name = None; lib_findlib_directory = None; @@ -7404,7 +7404,7 @@ let setup_t = }); Library ({ - cs_name = "vyconf-client"; + cs_name = "vyconf-config"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, @@ -7413,7 +7413,12 @@ let setup_t = bs_install = [(OASISExpr.EBool true, true)]; bs_path = "src"; bs_compiled_object = Best; - bs_build_depends = []; + bs_build_depends = + [ + FindlibPackage ("toml", None); + FindlibPackage ("fileutils", None); + FindlibPackage ("ppx_deriving.show", None) + ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = [ @@ -7536,7 +7541,7 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])] }, { - lib_modules = ["Vyconf_client"; "Vyconf_config"]; + lib_modules = ["Vyconf_config"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "vyconf"; @@ -7544,6 +7549,152 @@ let setup_t = lib_findlib_directory = None; lib_findlib_containers = [] }); + Library + ({ + cs_name = "vyconf-client"; + cs_data = PropList.Data.create (); + cs_plugin_data = [] + }, + { + bs_build = [(OASISExpr.EBool true, true)]; + bs_install = [(OASISExpr.EBool true, true)]; + bs_path = "src"; + bs_compiled_object = Best; + bs_build_depends = + [ + FindlibPackage ("ocaml-protoc", None); + FindlibPackage ("ocplib-endian", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_interface_patterns = + [ + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("capitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mli" + ]; + origin = "${capitalize_file module}.mli" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("uncapitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mli" + ]; + origin = "${uncapitalize_file module}.mli" + } + ]; + bs_implementation_patterns = + [ + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("capitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".ml" + ]; + origin = "${capitalize_file module}.ml" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("uncapitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".ml" + ]; + origin = "${uncapitalize_file module}.ml" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("capitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mll" + ]; + origin = "${capitalize_file module}.mll" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("uncapitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mll" + ]; + origin = "${uncapitalize_file module}.mll" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("capitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mly" + ]; + origin = "${capitalize_file module}.mly" + }; + { + OASISSourcePatterns.Templater.atoms = + [ + OASISSourcePatterns.Templater.Text ""; + OASISSourcePatterns.Templater.Expr + (OASISSourcePatterns.Templater.Call + ("uncapitalize_file", + OASISSourcePatterns.Templater.Ident + "module")); + OASISSourcePatterns.Templater.Text ".mly" + ]; + origin = "${uncapitalize_file module}.mly" + } + ]; + bs_c_sources = []; + bs_data_files = []; + bs_findlib_extra_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])] + }, + { + lib_modules = ["Vyconf_client"]; + lib_pack = false; + lib_internal_modules = ["Vyconf_pb"]; + lib_findlib_parent = Some "vyconf"; + lib_findlib_name = None; + lib_findlib_directory = None; + lib_findlib_containers = [] + }); Executable ({ cs_name = "vyconfd"; @@ -7557,18 +7708,14 @@ let setup_t = bs_compiled_object = Best; bs_build_depends = [ - FindlibPackage ("ppx_deriving_yojson", None); - FindlibPackage ("ppx_deriving.show", None); FindlibPackage ("lwt", None); FindlibPackage ("lwt.unix", None); FindlibPackage ("lwt.ppx", None); - FindlibPackage ("pcre", None); - FindlibPackage ("xml-light", None); - FindlibPackage ("toml", None); - FindlibPackage ("fileutils", None); FindlibPackage ("ocaml-protoc", None); FindlibPackage ("ocplib-endian", None); - FindlibPackage ("sha", None) + FindlibPackage ("sha", None); + InternalLibrary "vyconf"; + InternalLibrary "vyconf-config" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -7710,7 +7857,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("ppx_deriving_yojson", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -7852,9 +7999,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("ppx_deriving_yojson", None); - FindlibPackage ("xml-light", None); - FindlibPackage ("pcre", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -7999,7 +8144,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("ppx_deriving_yojson", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8280,7 +8425,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("pcre", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8425,8 +8570,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - InternalLibrary "vyconf"; - FindlibPackage ("xml-light", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8568,8 +8712,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("toml", None); - FindlibPackage ("ppx_deriving.runtime", None) + InternalLibrary "vyconf-config" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8714,7 +8857,7 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("ppx_deriving_yojson", None) + InternalLibrary "vyconf" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8859,11 +9002,8 @@ let setup_t = bs_build_depends = [ FindlibPackage ("oUnit", None); - FindlibPackage ("ppx_deriving_yojson", None); - FindlibPackage ("xml-light", None); - FindlibPackage ("fileutils", None); - FindlibPackage ("pcre", None); - FindlibPackage ("toml", None) + InternalLibrary "vyconf"; + InternalLibrary "vyconf-config" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -9002,8 +9142,7 @@ let setup_t = bs_install = [(OASISExpr.EBool true, false)]; bs_path = "test"; bs_compiled_object = Best; - bs_build_depends = - [FindlibPackage ("ppx_deriving_yojson", None)]; + bs_build_depends = [InternalLibrary "vyconf"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = [ @@ -9449,7 +9588,8 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.8"; - oasis_digest = Some "SN\201t\161Hz;0E\247\213\214\253\172\193"; + oasis_digest = + Some "\151\2510\223\204\141\167\020,\213\233\221p\208\207\198"; oasis_exec = None; oasis_setup_args = []; setup_update = false @@ -9457,7 +9597,7 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 9461 "setup.ml" +# 9601 "setup.ml" let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t open BaseCompat.Compat_0_4 (* OASIS_STOP *) -- cgit v1.2.3