From ef6ff33de1ebf88a5436793cedac68cf77c6f81e Mon Sep 17 00:00:00 2001 From: Guillaume Petiot Date: Mon, 26 Feb 2024 10:56:50 +0000 Subject: [PATCH] Reorganize the code and expose get-activity-lib --- bin/dune | 5 ++++ main.ml => bin/main.ml | 2 ++ main.mli => bin/main.mli | 0 dune | 4 --- dune-project | 9 ++++++- get-activity-lib.opam | 31 ++++++++++++++++++++++ get-activity.opam | 12 ++++----- contributions.ml => lib/contributions.ml | 0 contributions.mli => lib/contributions.mli | 0 lib/dune | 4 +++ graphql.ml => lib/graphql.ml | 0 token.ml => lib/token.ml | 0 token.mli => lib/token.mli | 0 13 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 bin/dune rename main.ml => bin/main.ml (99%) rename main.mli => bin/main.mli (100%) delete mode 100644 dune create mode 100644 get-activity-lib.opam rename contributions.ml => lib/contributions.ml (100%) rename contributions.mli => lib/contributions.mli (100%) create mode 100644 lib/dune rename graphql.ml => lib/graphql.ml (100%) rename token.ml => lib/token.ml (100%) rename token.mli => lib/token.mli (100%) diff --git a/bin/dune b/bin/dune new file mode 100644 index 0000000..6f08743 --- /dev/null +++ b/bin/dune @@ -0,0 +1,5 @@ +(executable + (name main) + (public_name get-activity) + (package get-activity) + (libraries cmdliner get-activity-lib)) diff --git a/main.ml b/bin/main.ml similarity index 99% rename from main.ml rename to bin/main.ml index b8644ef..7ef8cab 100644 --- a/main.ml +++ b/bin/main.ml @@ -1,3 +1,5 @@ +open Get_activity + let ( / ) = Filename.concat let or_die = function diff --git a/main.mli b/bin/main.mli similarity index 100% rename from main.mli rename to bin/main.mli diff --git a/dune b/dune deleted file mode 100644 index b275bb5..0000000 --- a/dune +++ /dev/null @@ -1,4 +0,0 @@ -(executable - (name main) - (public_name get-activity) - (libraries cohttp cohttp-lwt cohttp-lwt-unix yojson cmdliner)) diff --git a/dune-project b/dune-project index 71f1bb5..e0482da 100644 --- a/dune-project +++ b/dune-project @@ -1,15 +1,22 @@ -(lang dune 2.3) +(lang dune 2.8) (name get-activity) (formatting disabled) (generate_opam_files true) (source (github tarides/get-activity)) (authors "talex5@gmail.com") (maintainers "Guillaume Petiot ") + (package (name get-activity) (synopsis "Collect activity as markdown") (depends (cmdliner (>= 1.1.1)) + get-activity (= :version))) + +(package + (name get-activity-lib) + (synopsis "Collect activity as markdown") + (depends cohttp cohttp-lwt cohttp-lwt-unix diff --git a/get-activity-lib.opam b/get-activity-lib.opam new file mode 100644 index 0000000..9f576d4 --- /dev/null +++ b/get-activity-lib.opam @@ -0,0 +1,31 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "Collect activity as markdown" +maintainer: ["Guillaume Petiot "] +authors: ["talex5@gmail.com"] +homepage: "https://github.com/tarides/get-activity" +bug-reports: "https://github.com/tarides/get-activity/issues" +depends: [ + "dune" {>= "2.8"} + "cohttp" + "cohttp-lwt" + "cohttp-lwt-unix" + "yojson" + "ocaml" {>= "4.08"} + "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/tarides/get-activity.git" diff --git a/get-activity.opam b/get-activity.opam index 4869022..a06dd1d 100644 --- a/get-activity.opam +++ b/get-activity.opam @@ -6,16 +6,14 @@ authors: ["talex5@gmail.com"] homepage: "https://github.com/tarides/get-activity" bug-reports: "https://github.com/tarides/get-activity/issues" depends: [ - "dune" {>= "2.3"} + "dune" {>= "2.8"} "cmdliner" {>= "1.1.1"} - "cohttp" - "cohttp-lwt" - "cohttp-lwt-unix" - "yojson" - "ocaml" {>= "4.08"} + "get-activity" + "=" {version} + "odoc" {with-doc} ] build: [ - ["dune" "subst"] {pinned} + ["dune" "subst"] {dev} [ "dune" "build" diff --git a/contributions.ml b/lib/contributions.ml similarity index 100% rename from contributions.ml rename to lib/contributions.ml diff --git a/contributions.mli b/lib/contributions.mli similarity index 100% rename from contributions.mli rename to lib/contributions.mli diff --git a/lib/dune b/lib/dune new file mode 100644 index 0000000..cd7ce68 --- /dev/null +++ b/lib/dune @@ -0,0 +1,4 @@ +(library + (name get_activity) + (public_name get-activity-lib) + (libraries cohttp cohttp-lwt cohttp-lwt-unix yojson)) diff --git a/graphql.ml b/lib/graphql.ml similarity index 100% rename from graphql.ml rename to lib/graphql.ml diff --git a/token.ml b/lib/token.ml similarity index 100% rename from token.ml rename to lib/token.ml diff --git a/token.mli b/lib/token.mli similarity index 100% rename from token.mli rename to lib/token.mli