Skip to content

Commit 35e562d

Browse files
committed
Port to dune
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 58ecafc commit 35e562d

File tree

37 files changed

+400
-429
lines changed

37 files changed

+400
-429
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
JBUILDER ?= jbuilder
1+
DUNE ?= dune
22

33
all:
4-
$(JBUILDER) build --dev
4+
$(DUNE) build
55

66
tests:
7-
$(JBUILDER) runtest --dev
7+
$(DUNE) runtest
88

99
check: tests
1010

1111
clean:
12-
$(JBUILDER) clean
12+
$(DUNE) clean
1313

1414
all-supported-ocaml-versions:
15-
$(JBUILDER) runtest --dev --workspace jbuild-workspace.dev
15+
$(DUNE) runtest --workspace dune-workspace.dev
1616

1717
doc:
1818
cd doc && sphinx-build . _build

atd.opam

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ bug-reports: "https://github.com/mjambon/atd/issues"
77
dev-repo: "git://github.com/mjambon/atd.git"
88

99
build: [
10-
["jbuilder" "subst" "-n" name] {pinned}
11-
["jbuilder" "build" "-p" name "-j" jobs]
12-
["jbuilder" "runtest" "-p" name] {with-test}
10+
["dune" "subst"] {pinned}
11+
["dune" "build" "-p" name "-j" jobs]
12+
["dune" "runtest" "-p" name] {with-test}
1313
]
1414

1515
depends: [
1616
"ocaml" {>= "4.02.3"}
17-
"jbuilder" {build}
17+
"dune" {build}
1818
"menhir" {build}
1919
"easy-format"
2020
]

atd/src/dune

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(ocamllex lexer doc_lexer)
2+
(menhir (modules parser))
3+
4+
(library
5+
(name atd)
6+
(public_name atd)
7+
(flags (:include %{workspace_root}/ocamlflags.sexp))
8+
(libraries easy-format unix str))

atd/src/jbuild

-10
This file was deleted.

atd/test/dune

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(executables
2+
(libraries atd)
3+
(flags (:include %{workspace_root}/ocamlflags.sexp))
4+
(names unit_tests))
5+
6+
(alias
7+
(name runtest)
8+
(package atd)
9+
(action (run ./unit_tests.exe)))

atd/test/jbuild

-12
This file was deleted.

atdcat/dune

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(executables
2+
(names atdcat)
3+
(public_names atdcat)
4+
(flags (:include %{workspace_root}/ocamlflags.sexp))
5+
(libraries atd)
6+
(package atd))

atdcat/jbuild

-8
This file was deleted.

atdgen-codec-runtime/src/dune

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(library
2+
(name atdgen_codec_runtime)
3+
(public_name atdgen-codec-runtime))

atdgen-codec-runtime/src/jbuild

-5
This file was deleted.

atdgen-cppo/dune

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(install
2+
(section bin)
3+
(package atdgen)
4+
(files atdgen-cppo cppo-json))

atdgen-cppo/jbuild

-6
This file was deleted.

atdgen-runtime.opam

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ bug-reports: "https://github.com/mjambon/atd/issues"
77
dev-repo: "git://github.com/mjambon/atd.git"
88

99
build: [
10-
["jbuilder" "subst" "-n" name] {pinned}
11-
["jbuilder" "build" "-p" name "-j" jobs]
12-
["jbuilder" "runtest" "-p" name] {with-test}
10+
["dune" "subst"] {pinned}
11+
["dune" "build" "-p" name "-j" jobs]
12+
["dune" "runtest" "-p" name] {with-test}
1313
]
1414

1515
depends: [
1616
"ocaml" {>= "4.02.3"}
17-
"jbuilder" {build}
17+
"dune" {build}
1818
"biniou" {>= "1.0.6"}
1919
"yojson" {>= "1.2.1" }
2020
]

atdgen-runtime/src/dune

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(library
2+
(name atdgen_runtime)
3+
(public_name atdgen-runtime)
4+
(flags (:include %{workspace_root}/ocamlflags.sexp))
5+
(libraries biniou yojson))

atdgen-runtime/src/jbuild

-7
This file was deleted.

atdgen.opam

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ bug-reports: "https://github.com/mjambon/atd/issues"
77
dev-repo: "git://github.com/mjambon/atd.git"
88

99
build: [
10-
["jbuilder" "subst" "-n" name] {pinned}
11-
["jbuilder" "build" "-p" name "-j" jobs]
12-
["jbuilder" "runtest" "-p" name] {with-test}
10+
["dune" "subst"] {pinned}
11+
["dune" "build" "-p" name "-j" jobs]
12+
["dune" "runtest" "-p" name] {with-test}
1313
]
1414

1515
depends: [
1616
"ocaml" {>= "4.02.3"}
17-
"jbuilder" {build}
17+
"dune" {build}
1818
"atd" {>= "2.0.0"}
1919
"atdgen-runtime" {>= "2.0.0"}
2020
"biniou" {>= "1.0.6"}

atdgen/bin/dune

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(executables
2+
(libraries str atd atdgen_emit)
3+
(names ag_main)
4+
(flags (:include %{workspace_root}/ocamlflags.sexp))
5+
(public_names atdgen)
6+
(package atdgen))

atdgen/bin/jbuild

-8
This file was deleted.

atdgen/src/deprecated/dune

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
;; this is a deprecated library whose only purpose is to re-export the runtime
2+
;; new users should be using atdgen_runtime
3+
(library
4+
(name atdgen)
5+
(public_name atdgen)
6+
(flags (:include %{workspace_root}/ocamlflags.sexp))
7+
(libraries atdgen-runtime))

atdgen/src/deprecated/jbuild

-9
This file was deleted.

atdgen/src/dune

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(ocamllex doc_lexer)
2+
3+
(library
4+
(name atdgen_emit)
5+
(flags (:include %{workspace_root}/ocamlflags.sexp))
6+
(libraries atd yojson))

atdgen/src/jbuild

-8
This file was deleted.

atdgen/test/bucklescript/dune

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
(rule
2+
(targets bucklespec_bs.ml bucklespec_bs.mli)
3+
(deps bucklespec.atd)
4+
(action (run atdgen %{deps} -bs -open Bucklespec_t)))
5+
6+
(rule
7+
(targets bucklespec_t.ml bucklespec_t.mli)
8+
(deps bucklespec.atd)
9+
(action (run atdgen %{deps} -t)))
10+
11+
(rule
12+
(targets bucklespec_j.ml bucklespec_j.mli)
13+
(deps bucklespec.atd)
14+
(action (run atdgen %{deps} -j -j-std)))
15+
16+
(library
17+
(name bucklespec_types)
18+
(wrapped false)
19+
(libraries atdgen-codec-runtime)
20+
(modules bucklespec_t a_t a_bs))
21+
22+
(library
23+
(name bucklespec_bs)
24+
(wrapped false)
25+
(libraries atdgen-codec-runtime bucklespec_types)
26+
(modules bucklespec_bs))
27+
28+
(executable
29+
(name bucklespec_roundtrip)
30+
(modules bucklespec_roundtrip bucklespec_j a_j)
31+
(libraries bucklespec_types bucklespec_bs atdgen-runtime))
32+
33+
(alias
34+
(name runtest)
35+
(action (diff bucklespec_bs.expected.ml bucklespec_bs.ml)))
36+
37+
(alias
38+
(name runtest)
39+
(action (diff bucklespec_bs.expected.mli bucklespec_bs.mli)))
40+
41+
(alias
42+
(name runtest)
43+
(action (diff bucklespec_j.expected.ml bucklespec_j.ml)))
44+
45+
(alias
46+
(name runtest)
47+
(action (run ./bucklespec_roundtrip.exe)))

atdgen/test/bucklescript/jbuild

-50
This file was deleted.

0 commit comments

Comments
 (0)