Browse Source

port to dune

- update travis to test 4.07 as latest version
- fix compilation of async benchmark (broken before)
- bump minimum async version to v0.10.0 due to benchmark dep
- remove wrapped false as it seems to be unnecessary
Anil Madhavapeddy 3 years ago
parent
commit
259f7f1f36
22 changed files with 92 additions and 104 deletions
  1. 8 8
      .travis.yml
  2. 8 6
      Makefile
  3. 5 5
      angstrom-async.opam
  4. 4 4
      angstrom-lwt-unix.opam
  5. 4 4
      angstrom-unix.opam
  6. 4 4
      angstrom.opam
  7. 5 0
      async/dune
  8. 0 8
      async/jbuild
  9. 1 1
      benchmarks/async_benchmark.ml
  10. 14 0
      benchmarks/dune
  11. 0 16
      benchmarks/jbuild
  12. 2 0
      dune-project
  13. 11 0
      examples/dune
  14. 0 13
      examples/jbuild
  15. 5 0
      lib/dune
  16. 0 8
      lib/jbuild
  17. 12 0
      lib_test/dune
  18. 0 12
      lib_test/jbuild
  19. 5 0
      lwt/dune
  20. 0 8
      lwt/jbuild
  21. 4 0
      unix/dune
  22. 0 7
      unix/jbuild

+ 8 - 8
.travis.yml

@@ -8,14 +8,14 @@ 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"

+ 8 - 6
Makefile

@@ -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
-

+ 5 - 5
angstrom-async.opam

@@ -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"}
+  "dune" {build & >= "1.0"}
   "angstrom" {>= "0.7.0"}
-  "async" {>= "v0.9.0"}
+  "async" {>= "v0.10.0"}
 ]
 synopsis: "Async support for Angstrom"

+ 4 - 4
angstrom-lwt-unix.opam

@@ -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"

+ 4 - 4
angstrom-unix.opam

@@ -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"
 ]

+ 4 - 4
angstrom.opam

@@ -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"

+ 5 - 0
async/dune

@@ -0,0 +1,5 @@
+(library
+ (name angstrom_async)
+ (public_name angstrom-async)
+ (flags :standard -safe-string)
+ (libraries angstrom async))

+ 0 - 8
async/jbuild

@@ -1,8 +0,0 @@
-(jbuild_version 1)
-
-(library
- ((name        angstrom_async)
-  (public_name angstrom-async)
-  (wrapped false)
-  (flags (:standard -safe-string))
-  (libraries (angstrom async))))

+ 1 - 1
benchmarks/async_benchmark.ml

@@ -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 - 0
benchmarks/dune

@@ -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))

+ 0 - 16
benchmarks/jbuild

@@ -1,16 +0,0 @@
-(jbuild_version 1)
-
-(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))))

+ 2 - 0
dune-project

@@ -0,0 +1,2 @@
+(lang dune 1.0)
+(name angstrom)

+ 11 - 0
examples/dune

@@ -0,0 +1,11 @@
+(library
+ (name RFC7159)
+ (wrapped false)
+ (modules RFC7159)
+ (libraries angstrom))
+
+(library
+ (name RFC2616)
+ (wrapped false)
+ (modules RFC2616)
+ (libraries angstrom))

+ 0 - 13
examples/jbuild

@@ -1,13 +0,0 @@
-(jbuild_version 1)
-
-(library
- ((name RFC7159)
-  (wrapped false)
-  (modules RFC7159)
-  (libraries (angstrom))))
-
-(library
- ((name RFC2616)
-  (wrapped false)
-  (modules RFC2616)
-  (libraries (angstrom))))

+ 5 - 0
lib/dune

@@ -0,0 +1,5 @@
+(library
+ (name angstrom)
+ (public_name angstrom)
+ (libraries bigstringaf)
+ (flags :standard -safe-string))

+ 0 - 8
lib/jbuild

@@ -1,8 +0,0 @@
-(jbuild_version 1)
-
-(library
- ((name        angstrom)
-  (public_name angstrom)
-  (libraries (bigstringaf))
-  (flags   (:standard -safe-string))
-  ))

+ 12 - 0
lib_test/dune

@@ -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 %{<})))

+ 0 - 12
lib_test/jbuild

@@ -1,12 +0,0 @@
-(jbuild_version 1)
-
-(executables
- ((libraries (alcotest angstrom))
-  (modules (test_angstrom))
-  (names (test_angstrom))))
-
-(alias
- ((name   runtest)
-  (package angstrom)
-  (deps   (test_angstrom.exe))
-  (action (run ${<}))))

+ 5 - 0
lwt/dune

@@ -0,0 +1,5 @@
+(library
+ (name angstrom_lwt_unix)
+ (public_name angstrom-lwt-unix)
+ (flags :standard -safe-string)
+ (libraries angstrom lwt.unix))

+ 0 - 8
lwt/jbuild

@@ -1,8 +0,0 @@
-(jbuild_version 1)
-
-(library
- ((name        angstrom_lwt_unix)
-  (public_name angstrom-lwt-unix)
-  (wrapped false)
-  (flags (:standard -safe-string))
-  (libraries (angstrom lwt.unix))))

+ 4 - 0
unix/dune

@@ -0,0 +1,4 @@
+(library
+ (name angstrom_unix)
+ (public_name angstrom-unix)
+ (libraries angstrom unix))

+ 0 - 7
unix/jbuild

@@ -1,7 +0,0 @@
-(jbuild_version 1)
-
-(library
- ((name angstrom_unix)
-  (public_name angstrom-unix)
-  (wrapped false)
-  (libraries (angstrom unix))))