Skip to content

Commit 4327dee

Browse files
rgrinbergjordwalke
authored andcommitted
Show 4 uses of jbuilder
* Using external dep * Internal library * Library for opam export * Binary
1 parent b1da189 commit 4327dee

10 files changed

Lines changed: 52 additions & 5 deletions

File tree

internal-lib/jbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(jbuild_version 1)
2+
3+
;; why is this lib internal?
4+
;; because it doesn't have a public_name
5+
(library
6+
((name internal_lib)
7+
(libraries (re))))

internal-lib/m1.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
(* we can have ocaml as well as reason sources *)
3+
let opt = Re.opt

internal-lib/m2.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
let y = "testing"

reason-native-lib.opam

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
opam-version: "1.2"
2+
name: "ReasonNativeProject"
3+
version: "0.0.1"
4+
maintainer: "Jordan Walke <jordojw@gmail.com>"
5+
authors: [
6+
"Jordan Walke <jordojw@gmail.com>"
7+
"Maxwell Bernstein <max@bernsteinbear.com>"
8+
]
9+
license: "BSD"
10+
homepage: "https://github.com/reasonml/ReasonNativeProject"
11+
doc: "https://reasonml.github.io/ReasonNativeProject/"
12+
bug-reports: "https://github.com/reasonml/ReasonNativeProject/issues"
13+
dev-repo: "git://github.com/reasonml/ReasonNativeProject.git"
14+
tags: [ "reason" "example" ]
15+
build: [
16+
["jbuilder" "build" "-p" name "-j" jobs]
17+
]
18+
depends: [
19+
"jbuilder" {build}
20+
"reason" {= "1.13.3"}
21+
]
22+
available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ]

reason-native-lib/jbuild

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(jbuild_version 1)
2+
3+
(library
4+
((name reason_native_lib)
5+
(public_name reason-native-lib)
6+
(libraries (re))))

reason-native-lib/m1.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
let answer = 42;

reason-native-project.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build: [
1717
]
1818
depends: [
1919
"jbuilder" {build}
20+
"reason-native-lib"
2021
"reason" {= "1.13.3"}
2122
]
2223
available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ]

reason-native-project/jbuild

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(jbuild_version 1)
2+
3+
(executable
4+
((libraries (internal_lib reason-native-lib))
5+
(package reason-native-project)
6+
(name test)
7+
(public_name react_native_project)))

src/test.re renamed to reason-native-project/test.re

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ print_string msg;
77
print_newline ();
88
print_string "!!!!!!\n";
99

10+
let a = Reason_native_lib.M1.answer;
11+
Printf.printf "Answer: %d\n" a

src/jbuild

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)