Skip to content

Commit

Permalink
Switch to dune (ocaml-ppx#60)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
  • Loading branch information
jeremiedimino authored Dec 19, 2018
1 parent 104f80c commit fbf2a71
Show file tree
Hide file tree
Showing 22 changed files with 107 additions and 115 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)

.PHONY: all
all:
jbuilder build @install
dune build @install

.PHONY: install
install:
jbuilder install $(INSTALL_ARGS)
dune install $(INSTALL_ARGS)

.PHONY: uninstall
uninstall:
jbuilder uninstall $(INSTALL_ARGS)
dune uninstall $(INSTALL_ARGS)

.PHONY: reinstall
reinstall:
Expand All @@ -24,11 +24,11 @@ reinstall:

.PHONY: test
test:
jbuilder runtest
dune runtest

.PHONY: all-supported-ocaml-versions
all-supported-ocaml-versions:
jbuilder runtest --workspace jbuild-workspace.dev
dune runtest --workspace jbuild-workspace.dev

.PHONY: cinaps
cinaps:
Expand Down
3 changes: 3 additions & 0 deletions bin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(executables
(names ocaml_migrate_parsetree)
(libraries migrate_parsetree))
5 changes: 0 additions & 5 deletions bin/jbuild

This file was deleted.

4 changes: 4 additions & 0 deletions dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(install
(section doc)
(package ocaml-migrate-parsetree)
(files MANUAL.md))
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.6)
(name ocaml-migrate-parsetree)
4 changes: 0 additions & 4 deletions jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions ocamlbuild_plugin/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name migrate_parsetree_ocamlbuild)
(public_name ocaml-migrate-parsetree-ocamlbuild)
(synopsis "ocamlbuild plugin for automatically generating ppx dirvers")
(libraries ocamlbuild))
7 changes: 0 additions & 7 deletions ocamlbuild_plugin/jbuild

This file was deleted.

29 changes: 29 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
(library
(name migrate_parsetree)
(public_name ocaml-migrate-parsetree)
(wrapped false)
(libraries compiler-libs.common result ppx_derivers)
(flags :standard -open Result)
(modules :standard \ migrate_parsetree_driver_main)
(preprocess (action (run %{exe:../tools/pp.exe} %{read:ast-version}
%{input-file})))
(ppx.driver
(main Migrate_parsetree.Driver.run_main)
(flags --dump-ast)
(lint_flags --null)))

(library
(name migrate_parsetree_driver_main)
(public_name ocaml-migrate-parsetree.driver-main)
(modules migrate_parsetree_driver_main)
(library_flags -linkall)
(libraries migrate_parsetree))

(rule
(copy#
compiler-functions/%{read:compiler-functions-file}
migrate_parsetree_compiler_functions.ml))

(rule
(targets ast-version compiler-functions-file)
(action (run %{ocaml} %{dep:config/gen.ml} %{ocaml_version})))
30 changes: 0 additions & 30 deletions src/jbuild

This file was deleted.

17 changes: 17 additions & 0 deletions test/driver/manual/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(executable
(name driver)
(libraries ocaml-migrate-parsetree)
(link_flags -linkall))

(rule
(with-stdout-to driver.ml
(echo "Migrate_parsetree.Driver.run_main ()")))

(rule
(with-stdout-to file.blah
(echo "let x = 42")))

(alias
(name runtest)
(action (ignore-stdout
(run ./driver.exe --impl %{dep:file.blah}))))
18 changes: 0 additions & 18 deletions test/driver/manual/jbuild

This file was deleted.

16 changes: 16 additions & 0 deletions test/driver/null/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
(executable
(name ppx)
(flags :standard -linkall)
(libraries ppx1 ppx2))

(rule
(with-stdout-to null.output (run ./ppx.exe --null)))

(rule
(with-stdout-to null.expected (echo "")))

(alias
(name runtest)
(deps null.expected null.output)
(action (run diff -u null.expected null.output)))

16 changes: 0 additions & 16 deletions test/driver/null/jbuild

This file was deleted.

13 changes: 13 additions & 0 deletions test/driver/ppx-user/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(executable
(name foo)
(preprocess (pps ppx1 ppx2 --
-message "Hello, world!"
--cookie "plop=\"Chocolate\"")))

(rule
(with-stdout-to foo.output (run ./foo.exe)))

(alias
(name runtest)
(deps foo.expected foo.output)
(action (run diff -u foo.expected foo.output)))
15 changes: 0 additions & 15 deletions test/driver/ppx-user/jbuild

This file was deleted.

4 changes: 4 additions & 0 deletions test/driver/ppx1/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name ppx1)
(kind ppx_rewriter)
(libraries ocaml-migrate-parsetree))
4 changes: 0 additions & 4 deletions test/driver/ppx1/jbuild

This file was deleted.

4 changes: 4 additions & 0 deletions test/driver/ppx2/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name ppx2)
(kind ppx_rewriter)
(libraries ocaml-migrate-parsetree))
4 changes: 0 additions & 4 deletions test/driver/ppx2/jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions tools/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(executables
(names add_special_comments pp)
(libraries compiler-libs.common))

(ocamllex pp_rewrite)
7 changes: 0 additions & 7 deletions tools/jbuild

This file was deleted.

0 comments on commit fbf2a71

Please sign in to comment.