Skip to content

Commit 28ddebe

Browse files
committed
One last update.
1 parent d098333 commit 28ddebe

4 files changed

Lines changed: 13 additions & 17 deletions

File tree

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build:
77

88
# some boilerplate to publish a new version to GitHub
99
release:
10+
opam_of_packagejson.exe -gen-meta -gen-opam -gen-install package.json
1011
git add package.json opam
1112
git commit -m "Version $(version)"
1213
git tag -a $(version) -m "Version $(version)."

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,15 @@ The built output is in `_build` but the final binary is symlinked `_build/src/in
4040

4141
While developing you can simply modify the `_tags` file which is what `rebuild uses to figure out what you depend on. See inside that file for more instructions.
4242

43-
Before publishing onto opam you'll need to edit your `opam` file so that you depend on a particular opam package and range of versions.
43+
##### Releasing
4444

45-
In addition you may have to tweak the buildstep to recognize the dependency, by changing `build.ml` within the `pkg` folder. and add the following for you dependency:
46-
```ocaml
47-
...
48-
OS.Cmd.run @@ Cmd.(
49-
ocamlbuild % "-use-ocamlfind"
50-
%% (v "-I" % "src")
51-
%% (v "-pkg" % "[PACKAGE]") (* <---- only change is this line*)
52-
%% of_list files)
53-
...
54-
```
45+
Before publishing onto all you'll need to do is run `make release` to generate all of the files necessary for opam. Then you can follow the steps [here](https://opam.ocaml.org/doc/Packaging.html#GettingafullOPAMpackage).
46+
47+
If you've added extra opam dependencies you'll need to update the package.json under `opam > dependencies`. You can see all of the possible fields you can tweak on the [opam_of_packagejson](https://github.com/bsansouci/opam_of_packagejson) github.
5548

5649
Finally For your editor to pick up the dependency and fancy autocomplete etc. make sure to add the package in your `.merlin` file:
5750
```ocaml
58-
PKG topkg reason [PACKAGE]
51+
PKG reason [PACKAGE]
5952
```
6053

6154
### Creating Libraries

opam

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
opam-version: "1.2"
2+
name: "ReasonNativeProject"
23
version: "0.0.1"
34
license: "BSD"
45
dev-repo: "https://github.com/reasonml/ReasonNativeProject.git"
6+
homepage: "https://github.com/reasonml/ReasonNativeProject"
7+
bug-reports: "https://github.com/reasonml/ReasonNativeProject/issues"
58
maintainer: "FirstName LastName <email@email.com>"
69
authors: [ "FirstName LastName <email@email.com>" ]
710
depends: [
11+
"opam_of_packagejson" { build & >= "0.1.2" }
812
"reason" { build & >= "1.13.3" }
913
]
1014
build: [

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@
88
"url": "https://github.com/reasonml/ReasonNativeProject.git"
99
},
1010
"scripts": {
11-
"release": "opam_of_packagejson -gen-meta -gen-opam -gen-install package.json && opam publish"
12-
},
13-
"devDependencies": {
14-
"opam_of_packagejson": "*"
11+
"release": "make release"
1512
},
1613
"opam": {
1714
"dependencies": {
18-
"reason": "build & >= \"1.13.3\""
15+
"reason": "build & >= \"1.13.3\"",
16+
"opam_of_packagejson": "build & >= \"0.1.2\""
1917
}
2018
},
2119
"license": "BSD"

0 commit comments

Comments
 (0)