Skip to content

Commit

Permalink
CP-26404: Ported build from _oasis to jbuilder.
Browse files Browse the repository at this point in the history
Signed-off-by: Konstantina Chremmou <[email protected]>
  • Loading branch information
kc284 committed Jan 10, 2018
1 parent f06a5ea commit 97e557f
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 70 deletions.
27 changes: 5 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
*.annot
*.cmo
*.cma
*.cmi
*.a
*.o
*.cmx
*.cmxs
*.cmxa
_build
.merlin
*.install

/_build
/*.native
/*.byte

# OASIS
/setup.log
/setup.data
/setup.ml
/myocamlbuild.ml
/_tags
# DevFiles OASIS plugin:
/Makefile
/configure
*.rej
*.orig
8 changes: 0 additions & 8 deletions .merlin

This file was deleted.

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ script:
- bash -ex .travis-opam.sh
env:
global:
- OCAML_VERSION=4.02
- OCAML_VERSION=4.04
- TESTS=false
- PINS="xapi-storage-cli:."
matrix:
- BASE_REMOTE=git://github.com/xapi-project/xs-opam
- EXTRA_REMOTES=git://github.com/xapi-project/xs-opam
Expand Down
11 changes: 0 additions & 11 deletions INSTALL

This file was deleted.

2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ include a Signed-off-by: line.
Maintainers list
----------------

* David Scott <[email protected]>
* <[email protected]>

29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.PHONY: release build install uninstall clean test doc reindent

release:
jbuilder build @install

build:
jbuilder build @install --dev

install:
jbuilder install

uninstall:
jbuilder uninstall

clean:
jbuilder clean

test:
jbuilder runtest

# requires odoc
doc:
jbuilder build @doc

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


.DEFAULT_GOAL := release
14 changes: 0 additions & 14 deletions _oasis

This file was deleted.

39 changes: 39 additions & 0 deletions jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
(* -*- tuareg -*- *)
#require "unix"

let flags = function
| [] -> ""
| pkgs ->
let cmd = "ocamlfind ocamlc -verbose" ^ (
List.fold_left (fun acc pkg -> acc ^ " -package " ^ pkg) "" pkgs
) in
let ic = Unix.open_process_in
(cmd ^ " | grep -oEe '-ppx (\"([^\"\\]|\\.)+\"|\\w+)'")
in
let rec go ic acc =
try go ic (acc ^ " " ^ input_line ic) with End_of_file -> close_in ic; acc
in
go ic ""

let flags = flags ["ppx_deriving_rpc"]


let () = Printf.ksprintf Jbuild_plugin.V1.send {|
(jbuild_version 1)

(executable (
(name main)
(public_name sm-cli)
(flags (:standard -w -39 %s))
(libraries (
xcp
xcp.storage
re
re.str
rpclib
rpclib.json
cmdliner
threads
))
))
|} flags
17 changes: 4 additions & 13 deletions opam → xapi-storage-cli.opam
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
opam-version: "1.2"
name: "xapi-storage-cli"
maintainer: "[email protected]"
authors: [ "[email protected]" ]
license: "LGPL-2.1 with OCaml linking exception"
homepage: "https://github.com/xapi-project/sm-cli"
bug-reports: "https://github.com/xapi-project/sm-cli/issues"
dev-repo: "https://github.com/xapi-project/sm-cli.git"
build: [
["oasis" "setup"]
["./configure" "--bindir" "%{bin}%"]
[make]
]
install: [
[make "install"]
]
remove: [
["oasis" "setup"]
[make "uninstall"]
]
build: [[ "jbuilder" "build" "-p" name "-j" jobs ]]
depends: [
"oasis" {build}
"jbuilder" {build}
"base-threads"
"xapi-idl"
"re"
Expand Down

0 comments on commit 97e557f

Please sign in to comment.