From 266dc9ba416607ecc58409a9e4a10ff47861a943 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Tue, 11 Dec 2018 16:56:02 +0100 Subject: [PATCH 1/7] Migrate to dune & dune-release --- Makefile | 21 +++++++++++++-------- bench/dune | 5 +++++ bench/jbuild | 7 ------- bin/dune | 5 +++++ bin/jbuild | 7 ------- dune-project | 1 + examples/dune | 8 ++++++++ examples/jbuild | 10 ---------- lib/dune | 38 ++++++++++++++++++++++++++++++++++++++ lib/jbuild | 40 ---------------------------------------- pkg/pkg.ml | 2 -- yojson.opam | 8 ++++---- 12 files changed, 74 insertions(+), 78 deletions(-) mode change 100755 => 100644 Makefile create mode 100644 bench/dune delete mode 100644 bench/jbuild create mode 100644 bin/dune delete mode 100644 bin/jbuild create mode 100644 dune-project create mode 100644 examples/dune delete mode 100644 examples/jbuild create mode 100644 lib/dune delete mode 100644 lib/jbuild delete mode 100644 pkg/pkg.ml diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index dff0e5ca..3b2ae06d --- a/Makefile +++ b/Makefile @@ -1,21 +1,26 @@ +.PHONY: all all: - @jbuilder build @install @DEFAULT + @dune build @install @DEFAULT +.PHONY: test test: - @jbuilder runtest + @dune runtest --force +.PHONY: check check: test +.PHONY: install install: - @jbuilder install + @dune install +.PHONY: uninstall uninstall: - @jbuilder uninstall + @dune uninstall +.PHONY: bench bench: - @jbuilder build bench/bench.exe - -.PHONY: clean all bench test check install uninstall + @dune build bench/bench.exe +.PHONY: clean clean: - jbuilder clean + @dune clean diff --git a/bench/dune b/bench/dune new file mode 100644 index 00000000..1a43829a --- /dev/null +++ b/bench/dune @@ -0,0 +1,5 @@ +;; doesn't actually build b/c json_io doesn't exist +(executable + (name bench) + (flags (-safe-string)) + (libraries yojson)) diff --git a/bench/jbuild b/bench/jbuild deleted file mode 100644 index a439e116..00000000 --- a/bench/jbuild +++ /dev/null @@ -1,7 +0,0 @@ -;; doesn't actually build b/c json_io doesn't exist -(jbuild_version 1) - -(executable - ((name bench) - (flags (-safe-string)) - (libraries (yojson)))) diff --git a/bin/dune b/bin/dune new file mode 100644 index 00000000..3c6532c2 --- /dev/null +++ b/bin/dune @@ -0,0 +1,5 @@ +(executable + (name ydump) + (public_name ydump) + (flags (-safe-string)) + (libraries yojson)) diff --git a/bin/jbuild b/bin/jbuild deleted file mode 100644 index 0e14cca8..00000000 --- a/bin/jbuild +++ /dev/null @@ -1,7 +0,0 @@ -(jbuild_version 1) - -(executable - ((name ydump) - (public_name ydump) - (flags (-safe-string)) - (libraries (yojson)))) diff --git a/dune-project b/dune-project new file mode 100644 index 00000000..de4fc209 --- /dev/null +++ b/dune-project @@ -0,0 +1 @@ +(lang dune 1.0) diff --git a/examples/dune b/examples/dune new file mode 100644 index 00000000..921cf377 --- /dev/null +++ b/examples/dune @@ -0,0 +1,8 @@ +(executables + (names filtering) + (flags (-safe-string)) + (libraries yojson)) + +(alias + (name DEFAULT) + (deps filtering.exe)) diff --git a/examples/jbuild b/examples/jbuild deleted file mode 100644 index 4c5a021b..00000000 --- a/examples/jbuild +++ /dev/null @@ -1,10 +0,0 @@ -(jbuild_version 1) - -(executables - ((names (filtering)) - (flags (-safe-string)) - (libraries (yojson)))) - -(alias - ((name DEFAULT) - (deps (filtering.exe)))) diff --git a/lib/dune b/lib/dune new file mode 100644 index 00000000..574f3337 --- /dev/null +++ b/lib/dune @@ -0,0 +1,38 @@ +(ocamllex read) + +(rule + (targets yojson.ml) + (deps + (:out yojson.cppo.ml) + read.ml + write.ml + safe.ml + pretty.ml + write2.ml + common.ml + util.ml + type.ml) + (action (run cppo %{out} -o %{targets}))) + +(rule + (targets yojson.mli) + (deps + (:out yojson.cppo.mli) + write.mli + read.mli + safe.mli + pretty.mli + write2.mli + common.mli + util.mli + type.ml) + (action (run cppo %{out} -o %{targets}))) + +(library + (name yojson) + (public_name yojson) + (modules yojson yojson_biniou) + (wrapped false) + (synopsis "JSON parsing and printing (successor of json-wheel)") + (flags (-safe-string)) + (libraries easy-format biniou)) diff --git a/lib/jbuild b/lib/jbuild deleted file mode 100644 index 3f82564b..00000000 --- a/lib/jbuild +++ /dev/null @@ -1,40 +0,0 @@ -(jbuild_version 1) - -(ocamllex (read)) - -(rule - ((targets (yojson.ml)) - (deps - (yojson.cppo.ml - read.ml - write.ml - safe.ml - pretty.ml - write2.ml - common.ml - util.ml - type.ml)) - (action (run cppo ${<} -o ${@})))) - -(rule - ((targets (yojson.mli)) - (deps - (yojson.cppo.mli - write.mli - read.mli - safe.mli - pretty.mli - write2.mli - common.mli - util.mli - type.ml)) - (action (run cppo ${<} -o ${@})))) - -(library - ((name yojson) - (public_name yojson) - (modules (yojson yojson_biniou)) - (wrapped false) - (synopsis "JSON parsing and printing (successor of json-wheel)") - (flags (-safe-string)) - (libraries (easy-format biniou)))) diff --git a/pkg/pkg.ml b/pkg/pkg.ml deleted file mode 100644 index 1a04c2b4..00000000 --- a/pkg/pkg.ml +++ /dev/null @@ -1,2 +0,0 @@ -#use "topfind" -#require "topkg-jbuilder.auto" diff --git a/yojson.opam b/yojson.opam index ef332518..3a29cf74 100644 --- a/yojson.opam +++ b/yojson.opam @@ -6,13 +6,13 @@ bug-reports: "https://github.com/ocaml-community/yojson/issues" dev-repo: "git+https://github.com/ocaml-community/yojson.git" doc: "https://ocaml-community.github.io/yojson/" build: [ - ["jbuilder" "subst" "-n" name] {pinned} - ["jbuilder" "build" "-p" name "-j" jobs] + ["dune" "subst" "-n" name] {pinned} + ["dune" "build" "-p" name "-j" jobs] ] -run-test: ["jbuilder" "runtest" "-p" name] +run-test: ["dune" "runtest" "-p" name] depends: [ "ocaml" {>= "4.02.3"} - "jbuilder" {build} + "dune" {build} "cppo" {build} "easy-format" "biniou" {>= "1.2.0"} From a542b6a4bb6d052f64f510c50582729ce8205a1d Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Sat, 15 Dec 2018 18:05:29 +0100 Subject: [PATCH 2/7] Do not pass -n flag unnecessarily Thanks @avsm for the suggestion. --- yojson.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yojson.opam b/yojson.opam index 3a29cf74..236e11fc 100644 --- a/yojson.opam +++ b/yojson.opam @@ -6,7 +6,7 @@ bug-reports: "https://github.com/ocaml-community/yojson/issues" dev-repo: "git+https://github.com/ocaml-community/yojson.git" doc: "https://ocaml-community.github.io/yojson/" build: [ - ["dune" "subst" "-n" name] {pinned} + ["dune" "subst"] {pinned} ["dune" "build" "-p" name "-j" jobs] ] run-test: ["dune" "runtest" "-p" name] From 4b6c00dcc796bf295b90884146d76bf225d5fb72 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Sun, 16 Dec 2018 16:14:25 +0100 Subject: [PATCH 3/7] Update link to documentation When using dune-release it will generate the documentation automatically and push it to the gh-pages branch which will deploy to this URL. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 060f22cb..a6508f32 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ _This library is for manipulating the json AST directly. For mapping between OCa Library documentation --------------------- -Currently at https://mjambon.github.io/mjambon2016/yojson-doc/Yojson.html - -_The link above is for the ocamldoc-generated of some past version of yojson. Suggestions on how to keep this documentation updated automatically for each minor release are welcome._ +Currently at https://ocaml-community.github.io/yojson/ Design goals ------------ From ef718f8d096a86ea8d291cda993703119e6eba38 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Sun, 16 Dec 2018 16:24:44 +0100 Subject: [PATCH 4/7] Fix build of examples These had old instructions that weren't correct in the first place and scripts that didn't work. --- Makefile | 6 +++++- examples/Makefile | 6 ------ examples/dune | 2 +- examples/filtering.ml | 3 +-- examples/run-examples.sh | 5 ----- 5 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 examples/Makefile delete mode 100755 examples/run-examples.sh diff --git a/Makefile b/Makefile index 3b2ae06d..2d531eac 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ .PHONY: all all: - @dune build @install @DEFAULT + @dune build @install @examples + +.PHONY: run-examples +run-examples: + dune exec examples/filtering.exe < examples/filtering.json .PHONY: test test: diff --git a/examples/Makefile b/examples/Makefile deleted file mode 100644 index ab58ad91..00000000 --- a/examples/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -.PHONY: default -default: - ./run-examples.sh - -clean: - rm -f *.o *.a *.cm* *~ *.annot filtering diff --git a/examples/dune b/examples/dune index 921cf377..e1b4e8bb 100644 --- a/examples/dune +++ b/examples/dune @@ -4,5 +4,5 @@ (libraries yojson)) (alias - (name DEFAULT) + (name examples) (deps filtering.exe)) diff --git a/examples/filtering.ml b/examples/filtering.ml index d70f6099..3546f9fb 100644 --- a/examples/filtering.ml +++ b/examples/filtering.ml @@ -1,6 +1,5 @@ (* - ocamlfind ocamlopt -o filtering filtering.ml -package yojson -linkpkg - ./filtering < Date: Mon, 17 Dec 2018 11:22:20 +0100 Subject: [PATCH 5/7] Use executable stanza as there is only one --- examples/dune | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dune b/examples/dune index e1b4e8bb..b3c35177 100644 --- a/examples/dune +++ b/examples/dune @@ -1,5 +1,5 @@ -(executables - (names filtering) +(executable + (name filtering) (flags (-safe-string)) (libraries yojson)) From 58c31d6c95fdf02f804aa300b06399d472a724a4 Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 17 Dec 2018 11:22:36 +0100 Subject: [PATCH 6/7] Do not mislead about the existence of tests There are none yet, so no need for these stanzas. --- Makefile | 4 ---- yojson.opam | 1 - 2 files changed, 5 deletions(-) diff --git a/Makefile b/Makefile index 2d531eac..b4e92932 100644 --- a/Makefile +++ b/Makefile @@ -6,10 +6,6 @@ all: run-examples: dune exec examples/filtering.exe < examples/filtering.json -.PHONY: test -test: - @dune runtest --force - .PHONY: check check: test diff --git a/yojson.opam b/yojson.opam index 236e11fc..80b22776 100644 --- a/yojson.opam +++ b/yojson.opam @@ -9,7 +9,6 @@ build: [ ["dune" "subst"] {pinned} ["dune" "build" "-p" name "-j" jobs] ] -run-test: ["dune" "runtest" "-p" name] depends: [ "ocaml" {>= "4.02.3"} "dune" {build} From bbb576dbd15e9bf468260d4dd5744a162247df0f Mon Sep 17 00:00:00 2001 From: Marek Kubica Date: Mon, 17 Dec 2018 11:36:20 +0100 Subject: [PATCH 7/7] Remove check target --- Makefile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile b/Makefile index b4e92932..998c3006 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,6 @@ all: run-examples: dune exec examples/filtering.exe < examples/filtering.json -.PHONY: check -check: test - .PHONY: install install: @dune install