diff --git a/.gitignore b/.gitignore index 213ffe7..f0c113d 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,5 @@ _build/** *.byte *.install pkg/META - +.merlin /node_modules/ diff --git a/.merlin b/.merlin deleted file mode 100644 index 7893d97..0000000 --- a/.merlin +++ /dev/null @@ -1,6 +0,0 @@ -# This is a Merlin configuration file that enables your editor integration -# https://github.com/ocaml/merlin/wiki/project-configuration - -PKG topkg reason # the OPAM packages -B ./_build/src # built artifacts location -S ./src # source location diff --git a/Makefile b/Makefile index 3f2310c..938f923 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -14,6 +13,6 @@ release: git push "git@github.com:reasonml/ReasonNativeProject.git" tag $(version) clean: - ocamlbuild -clean + rm -rf _build *.install -.PHONY: build release +.PHONY: build release test diff --git a/_tags b/_tags deleted file mode 100644 index 3a10ef5..0000000 --- a/_tags +++ /dev/null @@ -1 +0,0 @@ -: -traverse diff --git a/internal-lib/jbuild b/internal-lib/jbuild new file mode 100644 index 0000000..eb783fa --- /dev/null +++ b/internal-lib/jbuild @@ -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)))) \ No newline at end of file diff --git a/internal-lib/m1.ml b/internal-lib/m1.ml new file mode 100644 index 0000000..6163447 --- /dev/null +++ b/internal-lib/m1.ml @@ -0,0 +1,3 @@ + +(* we can have ocaml as well as reason sources *) +let opt = Re.opt diff --git a/internal-lib/m2.re b/internal-lib/m2.re new file mode 100644 index 0000000..fa87917 --- /dev/null +++ b/internal-lib/m2.re @@ -0,0 +1,2 @@ + +let y = "testing" \ No newline at end of file diff --git a/pkg/META.in b/pkg/META.in deleted file mode 100644 index f9d0e0e..0000000 --- a/pkg/META.in +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (c) 2015-present, Facebook, Inc. All rights reserved. - -version = "%{version}%" -description = "ReasonNativeProject: Example project for Reason" - -archive(byte) = "ReasonNativeProject.cma" -archive(native) = "ReasonNativeProject.cmxa" diff --git a/pkg/build.ml b/pkg/build.ml deleted file mode 100644 index 1188890..0000000 --- a/pkg/build.ml +++ /dev/null @@ -1,17 +0,0 @@ -(* http://erratique.ch/software/topkg/doc/Topkg.html#basics *) - -open Topkg - -let () = - let cmd c os files = - let ocamlbuild = Conf.tool "rebuild" os in - OS.Cmd.run @@ Cmd.(ocamlbuild % "-use-ocamlfind" - %% (v "-I" % "src") - %% of_list files) - in - let build = Pkg.build ~cmd () in - Pkg.describe "ReasonNativeProject" ~build ~change_logs:[] ~licenses:[] ~readmes:[] (fun c -> - Ok [ - Pkg.lib "pkg/META"; - Pkg.bin ~auto:true ~dst:"test" "src/test"; - ]) diff --git a/reason-native-lib/jbuild b/reason-native-lib/jbuild new file mode 100644 index 0000000..8126ccd --- /dev/null +++ b/reason-native-lib/jbuild @@ -0,0 +1,6 @@ +(jbuild_version 1) + +(library + ((name reason_native_lib) + (public_name reason-native-project) + (libraries (re)))) \ No newline at end of file diff --git a/reason-native-lib/m1.re b/reason-native-lib/m1.re new file mode 100644 index 0000000..0c929c3 --- /dev/null +++ b/reason-native-lib/m1.re @@ -0,0 +1,2 @@ + +let answer = 42; \ No newline at end of file diff --git a/opam b/reason-native-project.opam similarity index 87% rename from opam rename to reason-native-project.opam index 5bd3e3b..3971206 100644 --- a/opam +++ b/reason-native-project.opam @@ -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" ] diff --git a/reason-native-project/jbuild b/reason-native-project/jbuild new file mode 100644 index 0000000..79cf7a1 --- /dev/null +++ b/reason-native-project/jbuild @@ -0,0 +1,6 @@ +(jbuild_version 1) + +(executable + ((libraries (internal_lib reason-native-project)) + (name test) + (public_name react_native_project))) diff --git a/src/test.re b/reason-native-project/test.re similarity index 68% rename from src/test.re rename to reason-native-project/test.re index f6f03c9..6bff471 100644 --- a/src/test.re +++ b/reason-native-project/test.re @@ -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 \ No newline at end of file