Skip to content

Commit

Permalink
Merge pull request #71 from smolkaj/master
Browse files Browse the repository at this point in the history
upgrade to dune, opam >= 2.0
  • Loading branch information
pmetzger authored Mar 5, 2019
2 parents 739b047 + 0478f07 commit 5d5dc43
Show file tree
Hide file tree
Showing 10 changed files with 88 additions and 95 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),)
.PHONY: build install uninstall clean doc test all

build:
jbuilder build @install
dune build @install

install:
jbuilder install $(INSTALL_ARGS)
dune install $(INSTALL_ARGS)

uninstall:
jbuilder uninstall $(INSTALL_ARGS)
dune uninstall $(INSTALL_ARGS)

clean:
jbuilder clean
dune clean

doc:
jbuilder build @doc
dune build @doc

test:
jbuilder build @runtest
dune build @runtest

all: build doc
all: build test doc
2 changes: 2 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
(lang dune 1.0)
(name sedlex)
41 changes: 41 additions & 0 deletions examples/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
(executables
(names tokenizer complement subtraction repeat performance)
(libraries sedlex)
(preprocess
(pps sedlex.ppx))
(flags :standard -w -39))

(alias
(name runtest)
(deps
(:< tokenizer.exe))
(action
(run %{<})))

(alias
(name runtest)
(deps
(:< complement.exe))
(action
(run %{<})))

(alias
(name runtest)
(deps
(:< subtraction.exe))
(action
(run %{<})))

(alias
(name runtest)
(deps
(:< repeat.exe))
(action
(run %{<})))

(alias
(name runtest)
(deps
(:< performance.exe))
(action
(run %{<})))
43 changes: 0 additions & 43 deletions examples/jbuild

This file was deleted.

2 changes: 1 addition & 1 deletion examples/performance.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let time f x =

let () =
let long_str = String.make 1000000 '\n' in
let token_from str =
let token_from _ =
let lexbuf = Sedlexing.Latin1.from_string long_str in
(* let () = Sedlexing.set_curr_p lexbuf Lexing.dummy_pos in *)
token lexbuf
Expand Down
40 changes: 22 additions & 18 deletions sedlex.opam
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
opam-version: "1.2"
opam-version: "2.0"
name: "sedlex"
version: "1.99.4"
synopsis: "An OCaml lexer generator for Unicode"
version: "1.99.5"
license: "MIT"
maintainer: "Alain Frisch <[email protected]>"
authors: [
"Alain Frisch <[email protected]>"
"https://github.com/ocaml-community/sedlex/graphs/contributors"
]
homepage: "https://github.com/ocaml-community/sedlex"
dev-repo: "git+https://github.com/ocaml-community/sedlex.git"
bug-reports: "https://github.com/ocaml-community/sedlex/issues"
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "@doc" "-p" name "-j" jobs] {with-doc}
]
depends: [
"ocaml" {build & >= "4.02.3"}
"dune" {build & >= "1.0"}
"ppx_tools_versioned"
"ocaml-migrate-parsetree"
"gen"
"uchar"
]

build: ["jbuilder" "build" "-p" name "-j" jobs]
build-doc: ["jbuilder" "build" "@doc" "-p" name "-j" jobs]
build-test: ["jbuilder" "runtest" "-p" name "-j" jobs]

depends: ["jbuilder" {build}
"ppx_tools_versioned"
"ocaml-migrate-parsetree"
"gen"
"uchar"
]
available: [ ocaml-version >= "4.02.3" ]
homepage: "https://github.com/alainfrisch/sedlex"
bug-reports: "https://github.com/alainfrisch/sedlex/issues"
license: "MIT"
dev-repo: "https://github.com/alainfrisch/sedlex.git"
6 changes: 6 additions & 0 deletions src/lib/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(library
(name sedlex)
(public_name sedlex)
(wrapped false)
(libraries gen uchar)
(flags :standard -w +A-4-9 -safe-string))
10 changes: 0 additions & 10 deletions src/lib/jbuild

This file was deleted.

9 changes: 9 additions & 0 deletions src/syntax/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(library
(name sedlex_ppx)
(public_name sedlex.ppx)
(kind ppx_rewriter)
(libraries ppx_tools_versioned.metaquot_405 ocaml-migrate-parsetree sedlex)
(ppx_runtime_libraries sedlex)
(preprocess
(pps ppx_tools_versioned.metaquot_405))
(flags (:standard -w -9)))
16 changes: 0 additions & 16 deletions src/syntax/jbuild

This file was deleted.

0 comments on commit 5d5dc43

Please sign in to comment.