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

Port to jbuilder #30

Open
wants to merge 9 commits into
base: RudiPlayground
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ _build/**
*.byte
*.install
pkg/META

.merlin
/node_modules/
6 changes: 0 additions & 6 deletions .merlin

This file was deleted.

13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# topkg (https://github.com/dbuenzli/topkg) is a small native packager for your lib
# http://erratique.ch/software/topkg/doc/Topkg.html#basics
build:
cp pkg/META.in pkg/META
ocamlbuild -package topkg pkg/build.native
./build.native build
jbuilder build

test:
jbuilder runtest

# some boilerplate to publish a new version to GitHub
release:
Expand All @@ -14,6 +13,6 @@ release:
git push "[email protected]:reasonml/ReasonNativeProject.git" tag $(version)

clean:
ocamlbuild -clean
rm -rf _build *.install

.PHONY: build release
.PHONY: build release test
1 change: 0 additions & 1 deletion _tags

This file was deleted.

7 changes: 7 additions & 0 deletions internal-lib/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(jbuild_version 1)

;; why is this lib internal?
;; because it doesn't have a public_name
(library
((name internal_lib)
(libraries (re))))
3 changes: 3 additions & 0 deletions internal-lib/m1.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

(* we can have ocaml as well as reason sources *)
let opt = Re.opt
2 changes: 2 additions & 0 deletions internal-lib/m2.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

let y = "testing"
7 changes: 0 additions & 7 deletions pkg/META.in

This file was deleted.

17 changes: 0 additions & 17 deletions pkg/build.ml

This file was deleted.

6 changes: 6 additions & 0 deletions reason-native-lib/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(jbuild_version 1)

(library
((name reason_native_lib)
(public_name reason-native-project)
(libraries (re))))
2 changes: 2 additions & 0 deletions reason-native-lib/m1.re
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

let answer = 42;
6 changes: 3 additions & 3 deletions opam → reason-native-project.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ doc: "https://reasonml.github.io/ReasonNativeProject/"
bug-reports: "https://github.com/reasonml/ReasonNativeProject/issues"
dev-repo: "git://github.com/reasonml/ReasonNativeProject.git"
tags: [ "reason" "example" ]
substs: [ "pkg/META" ]
build: [
[make "build"]
["jbuilder" "build" "-p" name "-j" jobs]
]
depends: [
"topkg" {>= "0.8.1" & < "0.9"}
"jbuilder" {build}
"reason-native-lib"
"reason" {= "1.13.3"}
]
available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ]
6 changes: 6 additions & 0 deletions reason-native-project/jbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(jbuild_version 1)

(executable
((libraries (internal_lib reason-native-project))
(name test)
(public_name react_native_project)))
2 changes: 2 additions & 0 deletions src/test.re → reason-native-project/test.re
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ print_string msg;
print_newline ();
print_string "!!!!!!\n";

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