From d4565c63f76012797d0b2f23905c0946d0abc857 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 | 17 ++++++++++++----- 2 files changed, 13 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..6e996ee 100644 --- a/src/dune +++ b/src/dune @@ -1,5 +1,12 @@ -(library - (name routes) - (public_name routes) - (preprocess - (pps bisect_ppx --conditional))) +(* -*- tuareg -*- *) + +let preprocess = + match Sys.getenv "BISECT_ENABLE" with + | exception _ -> "" + | "yes" -> "(preprocess (pps bisect_ppx))" + | _ -> "" + +let () = Jbuild_plugin.V1.send @@ {| + (library + (name routes) + (public_name routes)|} ^ preprocess ^ {|)|}