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

xapi-idl: jbuilderize #174

Merged
merged 20 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from 15 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
30 changes: 30 additions & 0 deletions .coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh

set -ex

COVERAGE_DIR=.coverage
rm -rf $COVERAGE_DIR
mkdir -p $COVERAGE_DIR
pushd $COVERAGE_DIR
if [ -z "$KEEP" ]; then trap "popd; rm -rf $COVERAGE_DIR" EXIT; fi

$(which cp) -r ../* .

opam install bisect_ppx ocveralls -y

export BISECT_ENABLE=YES
jbuilder runtest

outs=$(find . | grep bisect.*.out)
bisect-ppx-report -I $(dirname $outs[1]) -text report $outs
bisect-ppx-report -I $(dirname $outs[1]) -summary-only -text summary $outs
if [ -n "$HTML" ]; then bisect-ppx-report -I $(dirname $outs[1]) -html ../html-report $outs; fi

if [ -n "$TRAVIS" ]; then
echo "\$TRAVIS set; running ocveralls and sending to coveralls.io..."
ocveralls --prefix _build/default $outs --send
else
echo "\$TRAVIS not set; displaying results of bisect-report..."
cat report
cat summary
fi
16 changes: 2 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
*.annot
*.cmo
*.cma
*.cmi
*.a
*.o
*.cmx
*.cmxs
*.cmxa
*.native

*.merlin
*.install
*.swp

_build
setup.bin
setup.data
setup.log
30 changes: 0 additions & 30 deletions .merlin

This file was deleted.

6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
language: c
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-travisci-skeleton/master/.travis-docker.sh
- wget https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/travis-coveralls.sh
script:
- bash -ex .travis-docker.sh
- if [ ! -z "${XS_COV}" ]; then bash -ex travis-coveralls.sh || true; fi
sudo: required
services:
- docker
env:
global:
- OCAML_VERSION=4.04.2
- PINS="xcp:."
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a similar thing for stdext and I already start regretting it... Should we instead update all the package references and use xapi-idl once and for all? For the rrd-stuff port I decided to go and update all the packages, it's annoing and invasive but it's a cleanup afterall. I'd like to know @robhoes and @lindig point of view as well.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been giving a few thoughts about this. I think for the time being, for libraries like this or stdext that are pervasive across the whole product, we should value backward compatibility over coherence. After we are done with the ports, we can go an kill the backward compatibility hacks all at once.

- PACKAGE=xapi-idl
- DISTRO="debian-unstable"
matrix:
- BASE_REMOTE=git://github.com/xapi-project/xs-opam XS_COV=1 COV_CONF="ocaml setup.ml -configure --enable-tests"
- BASE_REMOTE=git://github.com/xapi-project/xs-opam \
POST_INSTALL_HOOK="env TRAVIS=$TRAVIS TRAVIS_JOB_ID=$TRAVIS_JOB_ID bash -ex .coverage.sh"
- EXTRA_REMOTES=git://github.com/xapi-project/xs-opam
matrix:
fast_finish: true
Expand Down
45 changes: 20 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
.PHONY: all clean install build
all: build doc
.PHONY: build release install uninstall clean test doc reindent

NAME=xcp
J=4
build:
jbuilder build @install --dev -j $$(getconf _NPROCESSORS_ONLN)

export OCAMLRUNPARAM=b
release:
jbuilder build @install

setup.bin: setup.ml
@ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
@rm -f setup.cmx setup.cmi setup.o setup.cmo
install:
jbuilder install

setup.data: setup.bin
@./setup.bin -configure
uninstall:
jbuilder uninstall

build: setup.data setup.bin
@./setup.bin -build -j $(J)

doc: setup.data setup.bin
@./setup.bin -doc -j $(J)
clean:
jbuilder clean

install: setup.bin
@./setup.bin -install
test:
jbuilder runtest --dev -j $$(getconf _NPROCESSORS_ONLN)

test: setup.bin build
@./setup.bin -test -verbose true
# requires odoc
doc:
jbuilder build @doc

reinstall: setup.bin
@ocamlfind remove $(NAME) || true
@./setup.bin -reinstall
gh-pages:
bash .docgen.sh

clean:
@ocamlbuild -clean
@rm -f setup.data setup.log setup.bin
reindent:
git ls-files '*.ml' '*.mli' | xargs ocp-indent --syntax cstruct -i
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to update the internal documentation using this: it's much cleaner than our default Makefile

113 changes: 0 additions & 113 deletions _oasis

This file was deleted.

Loading