Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced jbuild files with dune. #97

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ env:
- BASE_REMOTE="https://github.com/xapi-project/xs-opam.git"
- secure: "HswxrOJpdVA+i26zbpi47w9GsS25ix8w8gu+9GSi7tJ5AuWrBvVWV2PQ9CN1kVILzQFou1c/PeCyijvN5xudnRC7bRQETYazVfAUO5Fpu6UhYO1YQL69oo+vVzgLwVRicn5Pj3/sCR6McHekFe4Tt08tYM3oj3apA37qxeWx0Dw="
matrix:
- DISTRO="debian-9-ocaml-4.06"
- DISTRO="debian-9-ocaml-4.07"
27 changes: 10 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
PYTHON_PREFIX?=/usr
OPAM_PREFIX?=$(shell opam config var prefix)
OPAM_LIBDIR?=$(shell opam config var lib)
PROFILE=release

.PHONY: release build install uninstall clean test lint doc reindent

release:
jbuilder build @install
jbuilder build @python
make -C _build/default/python
.PHONY: build install uninstall clean test lint doc reindent

build:
jbuilder build @install --dev
jbuilder build @python --dev
dune build @install --profile=$(PROFILE)
dune build @python --profile=$(PROFILE)
make -C _build/default/python

install:
jbuilder install --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR) xapi-storage
dune install --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR) xapi-storage
make -C _build/default/python install PREFIX=$(PYTHON_PREFIX)

uninstall:
jbuilder uninstall --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR) xapi-storage
dune uninstall --prefix=$(OPAM_PREFIX) --libdir=$(OPAM_LIBDIR) xapi-storage
make -C _build/default/python uninstall

clean:
jbuilder clean
dune clean

test:
jbuilder runtest
dune runtest

lint:
jbuilder build @python
dune build @python
pylint --disable=line-too-long,too-few-public-methods,unused-argument,no-self-use,invalid-name,broad-except,protected-access,redefined-builtin,too-many-lines,wildcard-import,too-many-branches,too-many-arguments,unused-wildcard-import,raising-format-tuple,too-many-statements,duplicate-code _build/default/python/xapi/storage/api/v5/*.py
pycodestyle --ignore=E501 _build/default/python/xapi/storage/api/v5/*.py

# requires odoc
doc:
jbuilder build @doc
dune build @doc

reindent:
git ls-files '*.ml*' | xargs ocp-indent --syntax cstruct -i


.DEFAULT_GOAL := release
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 1.4)
1 change: 0 additions & 1 deletion generator/lib/data.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Rpc
open Idl
open Common

Expand Down
8 changes: 8 additions & 0 deletions generator/lib/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(library
(name xapi_storage)
(public_name xapi-storage)
(flags (:standard -warn-error +a-3))
(modules apis common control data files plugin task)
(preprocess (pps ppx_deriving_rpc))
(libraries rpclib)
)
12 changes: 0 additions & 12 deletions generator/lib/jbuild

This file was deleted.

10 changes: 4 additions & 6 deletions generator/src/jbuild → generator/src/dune
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
(jbuild_version 1)

(executable (
(executable
(name main)
(libraries (
(libraries
xapi-storage
unix
cmdliner
rpclib.markdown
))
))
)
)
2 changes: 0 additions & 2 deletions generator/src/main.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Cmdliner

let gen_markdown path =
let open Rpc.Types in
let open Xapi_storage in
let open Files in

Expand All @@ -17,7 +16,6 @@ let gen_markdown path =
`Ok ()

let gen_python path =
let open Rpc.Types in
let open Xapi_storage in
let open Files in

Expand Down
18 changes: 18 additions & 0 deletions generator/test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(executable
(name storage_test)
(libraries
alcotest
lwt
lwt.unix
xapi_storage
)
)

(alias
(name runtest)
(deps
(:x storage_test.exe)
(source_tree ../../rpc-light)
)
(action (run %{x}))
)
20 changes: 0 additions & 20 deletions generator/test/jbuild

This file was deleted.

1 change: 0 additions & 1 deletion jbuild

This file was deleted.

11 changes: 11 additions & 0 deletions python/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(alias
(name python)
(deps
(:x ../generator/src/main.exe)
(source_tree .)
)
(action (progn
(run mkdir -p xapi/storage/api/v5)
(run %{x} gen_python -p xapi/storage/api/v5)
))
)
13 changes: 0 additions & 13 deletions python/jbuild

This file was deleted.

5 changes: 2 additions & 3 deletions xapi-storage.opam
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ homepage: "https://xapi-project.github.io/"
bug-reports: "https://github.com/xapi-project/xapi-storage/issues"
dev-repo: "git://github.com/xapi-project/xapi-storage.git"
build: [
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "-p" name "-j" jobs]
]
depends: [
"ocaml"
"jbuilder" {build}
"dune" {build}
"ounit" {with-test}
"alcotest" {with-test}
"lwt" {with-test}
Expand Down