diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 8b95df3b..8e0131ec 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -19,10 +19,17 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: 4.14 - run: opam install dune + + - run: opam install . --deps-only --with-test + - run: opam exec -- dune build --profile release + - run: opam install . --deps-only --with-test + working-directory: aslp_server - run: opam exec -- dune build --profile release + working-directory: aslp_server diff --git a/asli.opam b/asli.opam index c36f30e1..113ecdfb 100644 --- a/asli.opam +++ b/asli.opam @@ -26,9 +26,6 @@ depends: [ "z3" {>= "4.8.7"} "alcotest" {with-test} "ppx_blob" - "lwt" - "cohttp-lwt-unix" - "yojson" "mlbdd" "odoc" {with-doc} ] diff --git a/aslp_server/aslp_server.opam b/aslp_server/aslp_server.opam new file mode 100644 index 00000000..68be2ccd --- /dev/null +++ b/aslp_server/aslp_server.opam @@ -0,0 +1,33 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "REST server for ASLp" +description: "" +maintainer: ["ailrst"] +authors: ["ailrst"] +license: "BSD-3-Clause" +homepage: "https://github.com/UQ-PAC/aslp" +doc: "https://github.com/UQ-PAC/aslp" +bug-reports: "https://github.com/UQ-PAC/aslp/issues" +depends: [ + "ocaml" + "dune" {>= "2.8"} + "cohttp-lwt-unix" + "yojson" + "asli" + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/UQ-PAC/aslp.git" diff --git a/aslp_server/bin/dune b/aslp_server/bin/dune new file mode 100644 index 00000000..3c9353cc --- /dev/null +++ b/aslp_server/bin/dune @@ -0,0 +1,7 @@ +(executable + (public_name aslp_server) + (modes exe byte) + (name main) + (modules main) + (libraries asli.libASL lwt.unix yojson cohttp-lwt cohttp-lwt-unix pprint)) + diff --git a/bin/server.ml b/aslp_server/bin/main.ml similarity index 97% rename from bin/server.ml rename to aslp_server/bin/main.ml index 759eee24..c1551c86 100644 --- a/bin/server.ml +++ b/aslp_server/bin/main.ml @@ -1,17 +1,9 @@ open LibASL - -open Yojson open Cohttp -open Cohttp_lwt open Cohttp_lwt_unix -open String open List -open Array open Asl_ast -open Value -open Eval -open Asl_utils open Lwt diff --git a/aslp_server/dune-project b/aslp_server/dune-project new file mode 100644 index 00000000..8c9f37ab --- /dev/null +++ b/aslp_server/dune-project @@ -0,0 +1,28 @@ +(lang dune 2.8) + +(name aslp_server) + +(generate_opam_files true) + +(source + (github UQ-PAC/aslp)) + +(authors "ailrst") +(maintainers "ailrst") + +(license BSD-3-Clause) + +(documentation https://github.com/UQ-PAC/aslp) + +(package + (name aslp_server) + (synopsis "REST server for ASLp") + (description "") + (depends ocaml dune + "cohttp-lwt-unix" + "yojson" + "asli" + ) + ) + +; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/aslp_server/dune-workspace b/aslp_server/dune-workspace new file mode 100644 index 00000000..e69de29b diff --git a/bin/dune b/bin/dune index 7b572c03..72b325f5 100644 --- a/bin/dune +++ b/bin/dune @@ -8,15 +8,6 @@ (libraries asli.libASL linenoise pprint) ) -(executable - (name server) - (public_name aslp-server) - (modes exe) - (modules server) - (flags (-cclib -lstdc++)) - (libraries asli.libASL pprint lwt.unix yojson cohttp-lwt cohttp-lwt-unix)) - - (executable (name testlexer) (modes exe) diff --git a/dune-project b/dune-project index ec36847e..f78a06fc 100644 --- a/dune-project +++ b/dune-project @@ -24,9 +24,6 @@ ("z3" (>= "4.8.7")) ("alcotest" :with-test) "ppx_blob" - "lwt" - "cohttp-lwt-unix" - "yojson" "mlbdd" ) )