Skip to content

Commit 51a7e8c

Browse files
committed
Initial commit
1 parent f77872c commit 51a7e8c

5 files changed

Lines changed: 77 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ _build/**
1212
*.annot
1313
*.run
1414
*.opt
15+
*.native
16+
*.byte
17+
*.install
1518

1619
node_modules

Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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

opam

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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" ]

pkg/META

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
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"

pkg/build.ml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
]

0 commit comments

Comments
 (0)