Skip to content

Commit

Permalink
Convert to Dune
Browse files Browse the repository at this point in the history
  • Loading branch information
aantron committed Nov 20, 2018
1 parent fd80378 commit 7a69a59
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 44 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ VERSION := 0.6.2

.PHONY : build
build :
jbuilder build --dev
dune build

.PHONY : test
test :
jbuilder runtest --dev --no-buffer -j 1
dune runtest --no-buffer -j 1

BISECT_FILES_PATTERN := _build/default/test/bisect*.out
COVERAGE_DIR := _coverage

.PHONY : coverage
coverage :
BISECT_ENABLE=yes jbuilder build --dev @build-test
BISECT_ENABLE=yes dune build @build-test
rm -rf $(BISECT_FILES_PATTERN)
(cd _build/default/test && ./test.exe)
bisect-ppx-report \
Expand All @@ -27,7 +27,7 @@ BS4_MISSING := Beautiful Soup not installed. Skipping Python performance test.

.PHONY : performance-test
performance-test :
jbuilder build --dev @build-performance-test
dune build @build-performance-test
(cd _build/default/test/performance && ./performance.exe)
@((python -c "import bs4" 2> /dev/null \
|| (echo $(BS4_MISSING); exit 1)) \
Expand Down Expand Up @@ -76,6 +76,6 @@ package-docs : docs

.PHONY : clean
clean :
jbuilder clean
dune clean
rm -rf $(COVERAGE_DIR)
# rm -rf docs/html
1 change: 1 addition & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 1.0)
8 changes: 3 additions & 5 deletions lambdasoup.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ dev-repo: "https://github.com/aantron/lambda-soup.git"
depends: [
# This should be removed for release.
"bisect_ppx" {>= "1.3.0"}
# As a consequence of depending on Jbuilder, Lambda Soup requires OCaml
# 4.02.3.
"jbuilder" {build & >= "1.0+beta10"}
# As a consequence of depending on Dune, Lambda Soup requires OCaml 4.02.3.
"dune" {build}
"markup" {>= "0.7.1"}
"ounit" {test}
]

build: [
["jbuilder" "build" "-p" name "-j" jobs]
["dune" "build" "-p" name "-j" jobs]
]
7 changes: 7 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(library
(name soup)
(public_name lambdasoup)
(synopsis "Easy functional HTML scraping and manipulation")
(flags (:standard -w +A -warn-error -3))
(preprocess (pps bisect_ppx -conditional))
(libraries markup))
9 changes: 0 additions & 9 deletions src/jbuild

This file was deleted.

13 changes: 13 additions & 0 deletions test/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(executable
(name test)
(flags (:standard -w +A))
(libraries lambdasoup oUnit))

(alias
(name build-test)
(deps test.exe (source_tree pages)))

(alias
(name runtest)
(deps test.exe (source_tree pages))
(action (run %{exe:test.exe})))
15 changes: 0 additions & 15 deletions test/jbuild

This file was deleted.

8 changes: 8 additions & 0 deletions test/performance/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(executable
(name performance)
(flags (:standard -w +A))
(libraries lambdasoup unix))

(alias
(name build-performance-test)
(deps performance.exe (source_tree ../pages)))
10 changes: 0 additions & 10 deletions test/performance/jbuild

This file was deleted.

0 comments on commit 7a69a59

Please sign in to comment.