Skip to content

Commit

Permalink
Modernize examples
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
  • Loading branch information
jeremiedimino committed Nov 27, 2018
1 parent f587844 commit 24b8f9b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions example/sample-projects/hello_world/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ The library is defined in =lib= and the executable in =bin=. It also
defines a test in =test=.

At the toplevel of the project, there is a =hello_world.opam=
file. This file is required so that =jbuilder= knows that this is the
file. This file is required so that =dune= knows that this is the
=hello_world= project.

To build everything that is meant to be installed in this project,
type:

#+begin_src
$ jbuilder build @install
$ dune build @install
#+end_src

To run the tests, type:

#+begin_src
$ jbuilder runtest
$ dune runtest
#+end_src
6 changes: 3 additions & 3 deletions example/sample-projects/hello_world/hello_world.opam
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
opam-version: "1.2"
opam-version: "2.0"
version: "1.0"
maintainer: "bob@sponge.com"
authors: ["SpongeBob"]
homepage: "https://github.com/SpongeBob/hello_world"
bug-reports: "https://github.com/SpongeCob/hello_world/issues"
dev-repo: "https://github.com/SpongeBob/hello_world.git"
dev-repo: "git+https://github.com/SpongeBob/hello_world.git"
license: "Apache-2.0"
build: [
["jbuilder" "build" "--only" "hello_world" "--root" "." "-j" jobs "@install"]
["dune" "build" "-p" name "-j" jobs]
]
6 changes: 3 additions & 3 deletions example/sample-projects/with-configure-step/README.org
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This project shows how to add a configure step to a project using
jbuilder.
dune.

In order to keep things composable, it offers several way to configure
the project:
Expand Down Expand Up @@ -27,10 +27,10 @@ Technically this is how it works:
=config.full= is what is used by the rest of the build.

Now in order to support (2) and (3), we setup the following rules in
the toplevel =jbuild=:
the toplevel =dune= file:
- a rule to produce =config= by copying =config.default=
- a rule to produce =config.full= by running =real_configure.ml=

The reason it all work as described is because if Jbuilder knows how
The reason it all work as described is because if Dune knows how
to build a file and this file is already present in the source tree,
it will always prefer the file that's already there
6 changes: 3 additions & 3 deletions example/sample-projects/with-configure-step/myproject.opam
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
opam-version: "1.2"
opam-version: "2.0"
version: "1.0"
maintainer: "bob@sponge.com"
authors: ["SpongeBob"]
homepage: "https://github.com/SpongeBob/myproject"
bug-reports: "https://github.com/SpongeCob/myproject/issues"
dev-repo: "https://github.com/SpongeBob/myproject.git"
dev-repo: "git+https://github.com/SpongeBob/myproject.git"
license: "Apache-2.0"
build: [
["jbuilder" "build" "--only" "myproject" "--root" "." "-j" jobs "@install"]
["dune" "build" "-p" name "-j" jobs]
]

0 comments on commit 24b8f9b

Please sign in to comment.