Skip to content

Commit

Permalink
Update version, readme and build files.
Browse files Browse the repository at this point in the history
  • Loading branch information
klakplok committed Feb 23, 2017
1 parent d4247f9 commit 8697dcc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 22 deletions.
12 changes: 6 additions & 6 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ src/json_encoding.cmo : src/json_schema.cmi src/json_repr.cmi \
src/json_query.cmi src/json_encoding.cmi
src/json_encoding.cmx : src/json_schema.cmx src/json_repr.cmx \
src/json_query.cmx src/json_encoding.cmi
src/json_repr_bson.cmo : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi src/json_repr_bson.cmi
src/json_repr_bson.cmx : src/json_repr.cmx src/json_query.cmx \
src/json_encoding.cmx src/json_repr_bson.cmi
src/json_repr_browser.cmo : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi src/json_repr_browser.cmi
src/json_repr_browser.cmx : src/json_repr.cmx src/json_query.cmx \
src/json_encoding.cmx src/json_repr_browser.cmi
src/json_repr_bson.cmo : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi src/json_repr_bson.cmi
src/json_repr_bson.cmx : src/json_repr.cmx src/json_query.cmx \
src/json_encoding.cmx src/json_repr_bson.cmi
src/json_repr.cmi :
src/json_query.cmi : src/json_repr.cmi
src/json_schema.cmi : src/json_repr.cmi src/json_query.cmi
src/json_encoding.cmi : src/json_schema.cmi src/json_repr.cmi \
src/json_query.cmi
src/json_repr_bson.cmi : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi
src/json_repr_browser.cmi : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi
src/json_repr_bson.cmi : src/json_repr.cmi src/json_query.cmi \
src/json_encoding.cmi
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

*~
*/*~
doc/

# ocamlbuild working directory
_build/
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
language: c
sudo: required
install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-opam.sh
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
script: bash -ex .travis-opam.sh
env:
- PACKAGE="ocplib-json-typed" OCAML_VERSION="4.02" DEPOPTS="js_of_ocaml"
- PACKAGE="ocplib-json-typed" OCAML_VERSION="4.03" DEPOPTS="js_of_ocaml"
- PACKAGE="ocplib-json-typed" OCAML_VERSION="4.02" DEPOPTS="js_of_ocaml ocplib-endian"
- PACKAGE="ocplib-json-typed" OCAML_VERSION="4.03" DEPOPTS="js_of_ocaml ocplib-endian"
- PACKAGE="ocplib-json-typed" OCAML_VERSION="4.04" DEPOPTS="js_of_ocaml ocplib-endian"
29 changes: 19 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
MAIN_MODULES = json_repr json_query json_schema json_encoding
BSON_MODULES = json_repr_bson
ALL_MODULES = $(MAIN_MODULES) $(BSON_MODULES)
ALL_MODULES = $(MAIN_MODULES)
ALL = \
src/ocplib_json_typed.cmxa \
src/ocplib_json_typed.cmxs \
src/ocplib_json_typed.cma \
src/ocplib_json_repr_bson.cmxa \
src/ocplib_json_repr_bson.cmxs \
src/ocplib_json_repr_bson.cma
src/ocplib_json_typed.cma

PACKAGES = ocplib-endian uri
PACKAGES = uri
SAFE_STRING = $(shell if ocamlc -safe-string 2> /dev/null ; then echo "-safe-string" ; fi)

ifeq ($(shell if ocamlfind query js_of_ocaml 2> /dev/null >&2 ; then echo "YES" ; fi),YES)
BROWSER_MODULES = json_repr_browser
ALL_MODULES += $(BROWSER_MODULES)
PACKAGES += js_of_ocaml
ALL += src/ocplib_json_repr_browser.cma
BROWSER_TARGETS = \
src/ocplib_json_repr_browser.cma
ALL += $(BROWSER_TARGETS)
$(BROWSER_TARGETS) doc: PACKAGES += js_of_ocaml
endif

ifeq ($(shell if ocamlfind query ocplib-endian 2> /dev/null >&2 ; then echo "YES" ; fi),YES)
BSOM_MODULES = json_repr_bson
ALL_MODULES += $(BSON_MODULES)
BSON_TARGETS = \
src/ocplib_json_repr_bson.cma \
src/ocplib_json_repr_bson.cmxa \
src/ocplib_json_repr_bson.cmxs
ALL += $(BSON_TARGETS)
$(BSON_TARGETS) doc: PACKAGES += ocplib-endian
endif

ML = $(patsubst %, src/%.ml, $(1))
Expand Down Expand Up @@ -76,8 +86,7 @@ test/test.asm: src/ocplib_json_typed.cmxa test/test.ml
$(call MLI, $(ALL_MODULES)) \
> $@

doc: \
$(call MLI, $(ALL_MODULES))
doc: all
-mkdir doc
ocamlfind ocamldoc -I src -html -d doc \
$(patsubst %, -package %, $(PACKAGES))\
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ This library is a collection of type-aware JSON utilities for OCaml.
The type of JSON documents handled by this library is directly
compatible with `ezjsonm`, but converters are provided for `yojson`
users, and an advanced functorial interface allows you to use any JSON
representation (for instance the Web browser's objects).
representation. Two other representations are also provided.

- `Json_repr_browser` interfaces JavaScripts objects. It is
available only when compiling to JavaScript via
`js_of_ocaml`. Users of `ocamlfind` can use the
`ocplib-json-typed.browser` subpackage. OPAM users must have
`js_of_ocaml` installed for this module to be available.
- `Json_repr_bson` is an implementation of a subset of BSON.
Users of `ocamlfind` can use the
`ocplib-json-typed.bson` subpackage. OPAM users must have
`ocplib-endian` installed for this module to be available.

Thanks to polymorphic variants, this library does not depend on any
JSON library, so you are free to use whichever you want for printing
Expand Down
4 changes: 2 additions & 2 deletions opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
opam-version: "1.2"
name: "ocplib-json-typed"
version: "0.4"
version: "0.5"
maintainer: "Benjamin Canou <benjamin@ocamlpro.com>"
authors: "Benjamin Canou <benjamin@ocamlpro.com>"
homepage: "https://github.com/ocamlpro/ocplib-json-typed"
Expand All @@ -15,9 +15,9 @@ install: [make "install"]
remove: [make "uninstall"]
depopts: [
"js_of_ocaml"
"ocplib-endian"
]
depends: [
"ocamlfind" {build}
"uri" {>= "1.9.0" }
"ocplib-endian"
]

0 comments on commit 8697dcc

Please sign in to comment.