-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8374f0a
Showing
13 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# http://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
|
||
# PEP8 says use 4-space indent | ||
[*.py] | ||
indent_size = 4 | ||
|
||
# Makefiles only support tab indents | ||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_build | ||
_coverage | ||
.merlin | ||
*.install | ||
bisect*.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
JaneStreet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This is free and unencumbered software released into the public domain. | ||
|
||
Anyone is free to copy, modify, publish, use, compile, sell, or | ||
distribute this software, either in source code form or as a compiled | ||
binary, for any purpose, commercial or non-commercial, and by any | ||
means. | ||
|
||
In jurisdictions that recognize copyright laws, the author or authors | ||
of this software dedicate any and all copyright interest in the | ||
software to the public domain. We make this dedication for the benefit | ||
of the public at large and to the detriment of our heirs and | ||
successors. We intend this dedication to be an overt act of | ||
relinquishment in perpetuity of all present and future rights to this | ||
software under copyright law. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
For more information, please refer to <http://unlicense.org/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
all: build | ||
|
||
build: | ||
@jbuilder build @install @examples | ||
|
||
clean: | ||
@rm -rf `find . -name 'bisect*.out'` _coverage | ||
@jbuilder clean | ||
|
||
coverage: clean | ||
@BISECT_ENABLE=YES jbuilder runtest | ||
@bisect-ppx-report -I _build/default/ -html _coverage/ \ | ||
`find . -name 'bisect*.out'` | ||
|
||
test: | ||
@jbuilder runtest --force | ||
|
||
.PHONY: all build clean coverage test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[![CircleCI](https://circleci.com/gh/brendanlong/ocaml-project-template.svg?style=shield)](https://circleci.com/gh/brendanlong/ocaml-project-template) | ||
[![Coverage Status](https://coveralls.io/repos/github/brendanlong/ocaml-project-template/badge.svg?branch=master)](https://coveralls.io/github/brendanlong/ocaml-project-template?branch=master) | ||
|
||
# Example OCaml project | ||
|
||
This is the base project I use when making new OCaml projects. It comes with: | ||
|
||
- Dune (jbuilder) build system | ||
- Git config | ||
- ocp-indent and EditorConfig for 2-space indent | ||
- Example opam config | ||
- A public-domain license (replace with a different one if you don't like it) | ||
- A generic OCaml CircleCI build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
open Example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(jbuild_version 1) | ||
|
||
(executables | ||
((names (example_bin)) | ||
(libraries (example)) | ||
(preprocess (pps (ppx_jane))))) | ||
|
||
(alias | ||
((name examples) | ||
(deps (example_bin.exe)))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: ocaml/opam:ubuntu-17.04_ocaml-4.05.0 | ||
environment: | ||
TERM: xterm | ||
steps: | ||
- checkout | ||
- run: | ||
name: Update opam | ||
command: | | ||
opam remote remove default | ||
opam remote add default https://opam.ocaml.org | ||
- run: | ||
name: Pin packages | ||
command: | | ||
for p in *.opam; do | ||
opam pin add -y -n ${p%.opam} . | ||
done | ||
- run: | ||
name: Install system dependencies | ||
command: opam depext -y `basename -s .opam *.opam | tr '\n' ' '` | ||
- run: | ||
name: Install OCaml dependencies | ||
command: opam install --deps-only -y `basename -s .opam *.opam | tr '\n' ' '` | ||
- run: | ||
# This is a separate step so we don't run tests for all of these ^ | ||
name: Install OCaml test dependencies | ||
command: opam install --deps-only -t -y `basename -s .opam *.opam | tr '\n' ' '` | ||
- run: | ||
name: Build | ||
command: opam config exec -- make | ||
- run: | ||
name: Test | ||
command: opam config exec -- make coverage | ||
- run: | ||
name: Install ocveralls | ||
command: opam install -y ocveralls | ||
- run: | ||
name: Upload coverage report | ||
command: | | ||
cd _build/default | ||
shopt -s globstar | ||
opam config exec -- ocveralls **/bisect*.out --send --repo_token $COVERALLS_REPO_TOKEN --git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
opam-version: "1.2" | ||
version: "0.1" | ||
maintainer: "you@example.com" | ||
homepage: "https://github.com/your-org/project-name" | ||
dev-repo: "https://github.com/your-org/project-name.git" | ||
bug-reports: "https://github.com/your-org/project-name/issues" | ||
|
||
build: ["jbuilder" "build" "-p" name "-j" jobs] | ||
build-test: ["jbuilder" "runtest" "-p" name "-j" jobs] | ||
|
||
depends: [ | ||
"ppx_jane" {build} | ||
"bisect_ppx" {build & >= "1.3.1"} | ||
"jbuilder" {build & >= "1.0+beta18"} | ||
|
||
"ounit" {test} | ||
] | ||
|
||
available: [ocaml-version >= "4.05.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
file regexp ".*_[jt].ml" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(jbuild_version 1) | ||
|
||
(library | ||
((name example) | ||
(public_name example) | ||
(libraries ()) | ||
(inline_tests ((flags (-verbose)))) | ||
(preprocess (pps (ppx_jane bisect_ppx -conditional | ||
(-exclude-file src/.exclude)))) | ||
(preprocessor_deps (.exclude)))) |