Skip to content

Commit

Permalink
Merge pull request #25 from anton-trunov/dune
Browse files Browse the repository at this point in the history
Switch the build system to Dune
  • Loading branch information
clarus authored Jun 10, 2020
2 parents d675bd7 + 04b225a commit b04fed1
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*~
*.swp
*.annot
*.cmo
*.cma
Expand All @@ -9,5 +10,6 @@
*.cmxs
*.cmxa
*.native
*.merlin
_build/
smartPrint.docdir
4 changes: 0 additions & 4 deletions META

This file was deleted.

15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
test:
dune runtest --profile release
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -40,7 +39,7 @@ Open an OCaml toplevel:

```ocaml
#use "topfind";;
#require "smart_print";;
#require "smart-print";;
open SmartPrint;;
```

Expand Down
15 changes: 15 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -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))
4 changes: 4 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(lang dune 2.0)
(package
(name smart-print)
(deprecated_package_names smart_print))
4 changes: 2 additions & 2 deletions smart-print.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion smartPrint.odocl

This file was deleted.

1 change: 0 additions & 1 deletion smartPrintLib.mllib

This file was deleted.

File renamed without changes.

0 comments on commit b04fed1

Please sign in to comment.