diff --git a/.gitignore b/.gitignore index 2a11959..5e4a388 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ +*.swp *.annot *.cmo *.cma @@ -9,5 +10,6 @@ *.cmxs *.cmxa *.native +*.merlin _build/ smartPrint.docdir diff --git a/META b/META deleted file mode 100644 index 0da8498..0000000 --- a/META +++ /dev/null @@ -1,4 +0,0 @@ -description = "SmartPrint pretty-printing library" -archive(byte) = "smartPrintLib.cma" -archive(native) = "smartPrintLib.cmxa" -version = "0.1" \ No newline at end of file diff --git a/Makefile b/Makefile index 09c5a9f..9ac6ac0 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,17 @@ default: - ocamlbuild smartPrintLib.cma smartPrintLib.cmxa + dune build --profile release install: default - ocamlfind install smart_print META _build/smartPrint.cmi _build/smartPrint.cmx _build/smartPrintLib.a _build/smartPrintLib.cma _build/smartPrintLib.cmxa _build/smartPrintLib.mllib + dune install uninstall: - ocamlfind remove smart_print + dune uninstall clean: - ocamlbuild -clean + dune clean doc: - ocamlbuild smartPrint.docdir/index.html + dune build @doc --profile release -test: default - ocamlbuild test.native - ./test.native |diff -s - test.out \ No newline at end of file +test: + dune runtest --profile release diff --git a/README.md b/README.md index bf6bfdc..b14b4e9 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,8 @@ Else download the sources and run: $ make # make install -You can also `make doc` and `make test`. To compile your programs with SmartPrint: - - $ ocamlbuild my_program.native -libs smart_print +You can also `make doc` and `make test`. To compile your programs with SmartPrint +add `smart-print` to the `libraries` stanza in your `dune` file(s). Do not forget to open the SmartPrint module in your code: @@ -40,7 +39,7 @@ Open an OCaml toplevel: ```ocaml #use "topfind";; -#require "smart_print";; +#require "smart-print";; open SmartPrint;; ``` diff --git a/dune b/dune new file mode 100644 index 0000000..1b1583f --- /dev/null +++ b/dune @@ -0,0 +1,15 @@ +(library + (name smart_print) + (wrapped false) + (public_name smart-print) + (modules smartPrint) + (synopsis "SmartPrint pretty-printing library")) + +(deprecated_library_name + (old_public_name smart_print) + (new_public_name smart-print)) + +(test + (name test) + (libraries smart_print) + (modules test)) diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..eea9e51 --- /dev/null +++ b/dune-project @@ -0,0 +1,4 @@ +(lang dune 2.0) +(package + (name smart-print) + (deprecated_package_names smart_print)) diff --git a/smart-print.opam b/smart-print.opam index b358c7c..d79e1b2 100644 --- a/smart-print.opam +++ b/smart-print.opam @@ -9,8 +9,8 @@ license: "BSD-3-Clause" depends: [ "ocaml" {>= "4.00.0"} - "ocamlfind" {build} - "ocamlbuild" {build} + "dune" {>= "2.0"} + "odoc" {with-doc} ] build: make dev-repo: "git://github.com/clarus/smart-print" diff --git a/smartPrint.odocl b/smartPrint.odocl deleted file mode 100644 index 2aa6ee8..0000000 --- a/smartPrint.odocl +++ /dev/null @@ -1 +0,0 @@ -SmartPrint \ No newline at end of file diff --git a/smartPrintLib.mllib b/smartPrintLib.mllib deleted file mode 100644 index 2aa6ee8..0000000 --- a/smartPrintLib.mllib +++ /dev/null @@ -1 +0,0 @@ -SmartPrint \ No newline at end of file diff --git a/test.out b/test.expected similarity index 100% rename from test.out rename to test.expected