From 03122c03b5c03f7e3d2f848046e3f020d5cd6df9 Mon Sep 17 00:00:00 2001 From: Anurag Soni Date: Mon, 23 Mar 2020 20:35:50 -0400 Subject: [PATCH] Use OCaml syntax to generate dune file Reference https://github.com/aantron/bisect_ppx/issues/294#issuecomment-602405301 --- .github/workflows/test.yml | 4 +--- src/dune | 16 +++++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 53e53a9..394fef2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,9 +16,7 @@ jobs: ocaml-version: ${{ matrix.ocaml-version }} - name: Install dependencies run: | - opam pin add routes.dev -n . - opam depext -yt routes - opam install -t . --deps-only + opam install dune alcotest - name: Run tests run: | opam exec -- dune runtest diff --git a/src/dune b/src/dune index 91b4e79..d58bac2 100644 --- a/src/dune +++ b/src/dune @@ -1,5 +1,11 @@ -(library - (name routes) - (public_name routes) - (preprocess - (pps bisect_ppx --conditional))) +(* -*- tuareg -*- *) + +let preprocess = + match Sys.getenv "BISECT_ENABLE" with + | "yes" -> "(preprocess (pps bisect_ppx))" + | _ | exception _ -> "" + +let () = Jbuild_plugin.V1.send @@ {| + (library + (name routes) + (public_name routes)|} ^ preprocess ^ {|)|}