Skip to content

Commit d7006c4

Browse files
authored
Merge pull request #88 from anuragsoni/switch-to-opam-2
Pre-requisite for a new release
2 parents 5bcd276 + 86a2869 commit d7006c4

File tree

16 files changed

+118
-106
lines changed

16 files changed

+118
-106
lines changed

Diff for: .gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@ examples/static_serve_override
4949
examples/uppercase_middleware
5050
lib_test/routes
5151
*.merlin
52-
*.install
52+
*.install
53+
_opam

Diff for: .travis.yml

+27-10
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
language: c
2-
sudo: false
2+
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-docker.sh
3+
script: bash -ex .travis-docker.sh
34
services:
4-
- docker
5-
install: wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
6-
script: bash -ex ./.travis-docker.sh
5+
- docker
76
env:
87
global:
98
- EXTRA_REMOTES="https://github.com/mirage/mirage-dev.git"
109
- PINS="opium_kernel:. opium:."
1110
matrix:
12-
- PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04.2"
13-
- PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04.2"
14-
- PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.03.0"
15-
- PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.03.0"
16-
- PACKAGE="opium_kernel" DISTRO="debian-unstable" OCAML_VERSION="4.03.0"
17-
- PACKAGE="opium" DISTRO="debian-unstable" OCAML_VERSION="4.03.0"
11+
- PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.04"
12+
- PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.04"
13+
- PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.05"
14+
- PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.05"
15+
- PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.06"
16+
- PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.06"
17+
- PACKAGE="opium_kernel" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
18+
- PACKAGE="opium" DISTRO="ubuntu-18.04" OCAML_VERSION="4.07"
19+
- PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
20+
- PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.04"
21+
- PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05"
22+
- PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.05"
23+
- PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
24+
- PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.06"
25+
- PACKAGE="opium_kernel" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07"
26+
- PACKAGE="opium" DISTRO="ubuntu-16.04" OCAML_VERSION="4.07"
27+
- PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.04"
28+
- PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.04"
29+
- PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.05"
30+
- PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.05"
31+
- PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.06"
32+
- PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.06"
33+
- PACKAGE="opium_kernel" DISTRO="alpine" OCAML_VERSION="4.07"
34+
- PACKAGE="opium" DISTRO="alpine" OCAML_VERSION="4.07"

Diff for: Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.DEFAULT_GOAL: all
22

3-
JBUILDER ?= jbuilder
3+
JBUILDER ?= dune
44

55
all:
6-
@$(JBUILDER) build --dev @install @DEFAULT
6+
@$(JBUILDER) build @install @DEFAULT
77

88
check:
9-
@$(JBUILDER) runtest --dev
9+
@$(JBUILDER) runtest
1010

1111
test: check
1212

@@ -19,4 +19,4 @@ clean:
1919
.PHONY: all clean check test
2020

2121
all-supported-ocaml-versions:
22-
$(JBUILDER) runtest --dev --workspace jbuild-workspace.dev
22+
$(JBUILDER) runtest --workspace dune-workspace.dev

Diff for: dune-project

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(lang dune 1.5)
2+
(name opium)

Diff for: dune-workspace.dev

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(lang dune 1.5)
2+
3+
;; This file is used by `make all-supported-ocaml-versions`
4+
(context (opam (switch 4.04.2)))
5+
(context (opam (switch 4.05.0)))
6+
(context (opam (switch 4.06.0)))

Diff for: examples/dune

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(executables
2+
(libraries re ezjsonm opium)
3+
(preprocess
4+
(pps ppx_sexp_conv)
5+
)
6+
(flags
7+
(:standard -safe-string)
8+
)
9+
(names auth_middleware exit_hook_example hello_world_basic hello_world_html hello_world middleware_ua read_json_body sample static_serve_override uppercase_middleware)
10+
)
11+
12+
(alias
13+
(name DEFAULT)
14+
(deps auth_middleware.exe exit_hook_example.exe hello_world_basic.exe hello_world_html.exe hello_world.exe middleware_ua.exe read_json_body.exe sample.exe static_serve_override.exe uppercase_middleware.exe)
15+
)

Diff for: examples/jbuild

-31
This file was deleted.

Diff for: lib_test/dune

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(test
2+
(name routes)
3+
(libraries alcotest opium)
4+
(package opium)
5+
(flags
6+
(:standard -safe-string)
7+
)
8+
)

Diff for: lib_test/jbuild

-12
This file was deleted.

Diff for: opium.opam

+18-11
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
opam-version: "1.2"
1+
opam-version: "2.0"
22
maintainer: "[email protected]"
33
authors: ["Rudi Grinberg"]
44
license: "MIT"
55

66
homepage: "https://github.com/rgrinberg/opium"
77
bug-reports: "https://github.com/rgrinberg/opium/issues"
8-
dev-repo: "https://github.com/rgrinberg/opium.git"
8+
dev-repo: "git+https://github.com/rgrinberg/opium.git"
9+
synopsis: "Sinatra like web toolkit based on Lwt + Cohttp"
10+
description: """
11+
Opium is a minimalistic library for quickly binding functions to http routes. Its features include (but not limited to):
12+
13+
Middleware system for app independent components
14+
A simple router for matching urls and parsing parameters
15+
Request/Response pretty printing for easier debugging
16+
"""
917

1018
build: [
11-
["jbuilder" "subst" "-n" name] {pinned}
12-
["jbuilder" "build" "-p" name "-j" jobs]
19+
["dune" "subst"] {pinned}
20+
["dune" "build" "-p" name "-j" jobs]
21+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
1322
]
14-
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
1523

1624
depends: [
17-
"jbuilder" {build}
25+
"ocaml" {>= "4.04.1"}
26+
"dune" {build}
1827
"opium_kernel"
1928
"cohttp-lwt-unix" {>= "0.99.0"}
2029
"base-unix"
2130
"lwt"
22-
"lwt_log"
31+
"logs"
2332
"cmdliner"
2433
"ppx_fields_conv" {>= "v0.9.0"}
2534
"ppx_sexp_conv" {>= "v0.9.0"}
2635
"re" {>= "1.3.0"}
2736
"magic-mime"
2837
"stringext"
29-
"alcotest" {test}
30-
"cow" {test & >= "0.10.0"}
38+
"alcotest" {with-test}
39+
"cow" {with-test & >= "0.10.0"}
3140
]
32-
33-
available: [ocaml-version >= "4.02.3"]

Diff for: opium/debug.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ open Opium_kernel.Rock
33

44
let exn_ e = Logs.err (fun f -> f "%s" (Printexc.to_string e))
55

6+
let log_src = Logs.Src.create "opium.server"
7+
68
let format_error req _exn = Printf.sprintf "
79
<html>
810
<body>
@@ -24,6 +26,6 @@ let trace =
2426
let filter handler req =
2527
handler req >|= fun response ->
2628
let code = response |> Response.code |> Cohttp.Code.code_of_status in
27-
Lwt_log.ign_debug_f "Responded with %d" code;
29+
Logs.debug ~src:log_src (fun m -> m "Responded with %d" code);
2830
response
2931
in Middleware.create ~name:"Trace" ~filter

Diff for: opium/dune

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(library
2+
(public_name opium)
3+
(flags
4+
(:standard -safe-string)
5+
)
6+
(preprocess
7+
(pps ppx_sexp_conv ppx_fields_conv)
8+
)
9+
(libraries opium_kernel cmdliner cohttp-lwt-unix magic-mime logs stringext)
10+
)

Diff for: opium/jbuild

-15
This file was deleted.

Diff for: opium_kernel.opam

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
opam-version: "1.2"
1+
opam-version: "2.0"
22
maintainer: "[email protected]"
33
authors: ["Rudi Grinberg"]
44
license: "MIT"
55

66
homepage: "https://github.com/rgrinberg/opium"
77
bug-reports: "https://github.com/rgrinberg/opium/issues"
8-
dev-repo: "https://github.com/rgrinberg/opium.git"
8+
dev-repo: "git+https://github.com/rgrinberg/opium.git"
9+
synopsis: "Sinatra like web toolkit based on Lwt + Cohttp"
10+
description: """
11+
Opium_kernel is the Unix indpendent core of Opium. Useful for extremely portable environments such as mirage.
12+
"""
913

1014
build: [
11-
["jbuilder" "subst" "-n" name] {pinned}
12-
["jbuilder" "build" "-p" name "-j" jobs]
15+
["dune" "subst"] {pinned}
16+
["dune" "build" "-p" name "-j" jobs]
17+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
1318
]
14-
build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]]
1519

1620
depends: [
17-
"jbuilder" {build}
21+
"ocaml" {>= "4.04.1"}
22+
"dune" {build}
1823
"hmap"
1924
"cohttp" {>= "0.99.0"}
2025
"cohttp-lwt" {>= "0.99.0"}
@@ -26,8 +31,6 @@ depends: [
2631
"ppx_fields_conv" {>= "v0.9.0"}
2732
"ppx_sexp_conv" {>= "v0.9.0"}
2833
"re" {>= "1.3.0"}
29-
"alcotest" {test}
30-
"cow" {test & >= "0.10.0"}
34+
"alcotest" {with-test}
35+
"cow" {with-test & >= "0.10.0"}
3136
]
32-
33-
available: [ocaml-version >= "4.02.3"]

Diff for: opium_kernel/dune

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(library
2+
(public_name opium_kernel)
3+
(flags
4+
(:standard -safe-string)
5+
)
6+
(preprocess
7+
(pps ppx_sexp_conv ppx_fields_conv)
8+
)
9+
(libraries hmap cohttp-lwt ezjsonm)
10+
)

Diff for: opium_kernel/jbuild

-11
This file was deleted.

0 commit comments

Comments
 (0)