File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,5 +12,8 @@ _build/**
1212* .annot
1313* .run
1414* .opt
15+ * .native
16+ * .byte
17+ * .install
1518
1619node_modules
Original file line number Diff line number Diff line change 1+ build :
2+ ocamlbuild -package topkg pkg/build.native
3+ ./build.native build
4+
5+ release :
6+ git add package.json opam
7+ git commit -m " Version $( version) "
8+ git tag -a $(version ) -m " Version $( version) ."
9+ # Push first the objects, then the tag.
10+ git push " git@github.com:reasonml/ReasonProject.git"
11+ git push " git@github.com:reasonml/ReasonProject.git" tag $(version )
12+
13+ clean :
14+ ocamlbuild -clean
15+
16+ .PHONY : build release
Original file line number Diff line number Diff line change 1+ opam-version: "1.2"
2+ name: "ReasonProject"
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/ReasonProject"
11+ doc: "https://reasonml.github.io/ReasonProject/"
12+ bug-reports: "https://github.com/reasonml/ReasonProject/issues"
13+ dev-repo: "git://github.com/reasonml/ReasonProject.git"
14+ tags: [ "reason" "example" ]
15+ substs: [ "pkg/META" ]
16+ build: [
17+ [make "build" "--native" "%{ocaml-native}%"]
18+ ]
19+ depends: [
20+ "topkg" {>= "0.8.1" & < "0.9"}
21+ "reason-parser" {= "1.13.3"}
22+ ]
23+ available: [ ocaml-version >= "4.02" & ocaml-version < "4.05" ]
Original file line number Diff line number Diff line change 1+ # Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
2+
3+ version = "%{version}%"
4+ description = "ReasonProject: Example project for Reason"
5+
6+ archive(byte) = "ReasonProject.cma"
7+ archive(native) = "ReasonProject.cmxa"
Original file line number Diff line number Diff line change 1+ (* Copyright (c) 2015-present, Facebook, Inc. All rights reserved. *)
2+
3+ open Topkg
4+
5+ let native = Conf. (key " native" bool ~absent: false )
6+
7+ let () =
8+ let cmd c os files =
9+ let ocamlbuild = Conf. tool " rebuild" os in
10+ OS.Cmd. run @@ Cmd. (ocamlbuild % " -use-ocamlfind"
11+ %% (v " -I" % " src" )
12+ %% of_list files)
13+ in
14+ let build = Pkg. build ~cmd () in
15+ Pkg. describe " ReasonProject" ~build ~change_logs: [] ~licenses: [] ~readmes: [] @@ fun c ->
16+ Ok [
17+ Pkg. lib " pkg/META" ;
18+ (* .native builds if --native true is passed *)
19+ Pkg. lib ~cond: (Conf. value c native)
20+ ~exts: (Exts. exts [" .native" ])
21+ ~dst: " test"
22+ " src/Test" ;
23+ (* .byte builds if --native is absent or passed as false *)
24+ Pkg. lib ~cond: (not (Conf. value c native))
25+ ~exts: (Exts. exts [" .byte" ])
26+ ~dst: " test"
27+ " src/Test" ;
28+ ]
You can’t perform that action at this time.
0 commit comments