Skip to content

Commit

Permalink
Merge pull request #161 from avsm/port-to-dune
Browse files Browse the repository at this point in the history
port to dune
  • Loading branch information
seliopou authored Feb 9, 2019
2 parents 5289e8f + 470687c commit 071e6eb
Show file tree
Hide file tree
Showing 22 changed files with 93 additions and 107 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@ env:
global:
- PINS="angstrom-async:. angstrom-lwt-unix:. angstrom-unix:. angstrom:."
matrix:
- PACKAGE="angstrom" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
- PACKAGE="angstrom-async" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
- PACKAGE="angstrom-lwt-unix" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
- PACKAGE="angstrom-unix" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
- PACKAGE="angstrom" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="angstrom-async" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="angstrom-lwt-unix" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="angstrom-unix" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
- PACKAGE="angstrom" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="angstrom-async" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="angstrom-lwt-unix" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="angstrom-unix" DISTRO="ubuntu-lts" OCAML_VERSION="4.07"
- PACKAGE="angstrom" DISTRO="ubuntu-lts" OCAML_VERSION="4.04"
- PACKAGE="angstrom-async" DISTRO="ubuntu-lts" OCAML_VERSION="4.04"
- PACKAGE="angstrom-lwt-unix" DISTRO="ubuntu-lts" OCAML_VERSION="4.04"
- PACKAGE="angstrom-unix" DISTRO="ubuntu-lts" OCAML_VERSION="4.04"
- PACKAGE="angstrom" DISTRO="alpine" OCAML_VERSION="4.03"
- PACKAGE="angstrom-async" DISTRO="alpine" OCAML_VERSION="4.03"
- PACKAGE="angstrom-lwt-unix" DISTRO="alpine" OCAML_VERSION="4.03"
- PACKAGE="angstrom-unix" DISTRO="alpine" OCAML_VERSION="4.03"
- PACKAGE="angstrom" DISTRO="debian-unstable" OCAML_VERSION="4.03"
- PACKAGE="angstrom-async" DISTRO="debian-unstable" OCAML_VERSION="4.03"
- PACKAGE="angstrom-lwt-unix" DISTRO="debian-unstable" OCAML_VERSION="4.03"
- PACKAGE="angstrom-unix" DISTRO="debian-unstable" OCAML_VERSION="4.03"
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
.PHONY: all build clean test
.PHONY: all build clean test install uninstall doc

build:
jbuilder build --dev @install
dune build

all: build

test:
jbuilder runtest --dev
dune runtest

install:
jbuilder install --dev
dune install

uninstall:
jbuilder uninstall
dune uninstall

doc:
dune build @doc

clean:
rm -rf _build *.install

12 changes: 6 additions & 6 deletions angstrom-async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ homepage: "https://github.com/inhabitedtype/angstrom"
bug-reports: "https://github.com/inhabitedtype/angstrom/issues"
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name] {with-test}
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.03.0"}
"jbuilder" {build & >= "1.0+beta10"}
"ocaml" {>= "4.04.1"}
"dune" {build & >= "1.0"}
"angstrom" {>= "0.7.0"}
"async" {>= "v0.9.0"}
"async" {>= "v0.10.0"}
]
synopsis: "Async support for Angstrom"
8 changes: 4 additions & 4 deletions angstrom-lwt-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ homepage: "https://github.com/inhabitedtype/angstrom"
bug-reports: "https://github.com/inhabitedtype/angstrom/issues"
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name] {with-test}
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.03.0"}
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.0"}
"angstrom"
"lwt"
"base-unix"
Expand Down
8 changes: 4 additions & 4 deletions angstrom-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ homepage: "https://github.com/inhabitedtype/angstrom"
bug-reports: "https://github.com/inhabitedtype/angstrom/issues"
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name] {with-test}
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.03.0"}
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.0"}
"angstrom"
"base-unix"
]
Expand Down
8 changes: 4 additions & 4 deletions angstrom.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ homepage: "https://github.com/inhabitedtype/angstrom"
bug-reports: "https://github.com/inhabitedtype/angstrom/issues"
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
build: [
["jbuilder" "subst" "-p" name] {pinned}
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name] {with-test}
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.03.0"}
"jbuilder" {build & >= "1.0+beta10"}
"dune" {build & >= "1.0"}
"alcotest" {with-test & >= "0.8.1"}
"bigstringaf"
"result"
Expand Down
5 changes: 5 additions & 0 deletions async/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name angstrom_async)
(public_name angstrom-async)
(flags :standard -safe-string)
(libraries angstrom async))
8 changes: 0 additions & 8 deletions async/jbuild

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/async_benchmark.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ let main parser () =

let () =
let parser = Command.Arg_type.of_alist_exn ["http", `Http; "json", `Json] in
Command.(async ~summary:"async benchmark"
Command.(async_spec ~summary:"async benchmark"
Spec.(empty +> Param.(anon ("PARSER" %: parser))) main |> run)
14 changes: 14 additions & 0 deletions benchmarks/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(executables
(libraries angstrom core_bench threads RFC2616 RFC7159)
(modules pure_benchmark)
(names pure_benchmark))

(executables
(libraries angstrom-async RFC2616 RFC7159)
(modules async_benchmark)
(names async_benchmark))

(executables
(libraries angstrom-lwt-unix RFC2616 RFC7159)
(modules lwt_benchmark)
(names lwt_benchmark))
16 changes: 0 additions & 16 deletions benchmarks/jbuild

This file was deleted.

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.0)
(name angstrom)
11 changes: 11 additions & 0 deletions examples/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(library
(name RFC7159)
(wrapped false)
(modules RFC7159)
(libraries angstrom))

(library
(name RFC2616)
(wrapped false)
(modules RFC2616)
(libraries angstrom))
13 changes: 0 additions & 13 deletions examples/jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions lib/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name angstrom)
(public_name angstrom)
(libraries bigstringaf)
(flags :standard -safe-string))
8 changes: 0 additions & 8 deletions lib/jbuild

This file was deleted.

12 changes: 12 additions & 0 deletions lib_test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(executables
(libraries alcotest angstrom)
(modules test_angstrom)
(names test_angstrom))

(alias
(name runtest)
(package angstrom)
(deps
(:< test_angstrom.exe))
(action
(run %{<})))
12 changes: 0 additions & 12 deletions lib_test/jbuild

This file was deleted.

5 changes: 5 additions & 0 deletions lwt/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name angstrom_lwt_unix)
(public_name angstrom-lwt-unix)
(flags :standard -safe-string)
(libraries angstrom lwt.unix))
8 changes: 0 additions & 8 deletions lwt/jbuild

This file was deleted.

4 changes: 4 additions & 0 deletions unix/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name angstrom_unix)
(public_name angstrom-unix)
(libraries angstrom unix))
7 changes: 0 additions & 7 deletions unix/jbuild

This file was deleted.

0 comments on commit 071e6eb

Please sign in to comment.