Source file bin.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module Internal = struct
let d_132072893c4898750d2418b319b29683 = "# 0.1.0 - 2020-01-01\n\n## Added\n\n- Initial release\n"
let d_15099a7cbce53724579df6a8d911be0b = "(lang dune 2.0)\n\n(name {{ project_slug }})\n\n{% if github_username %}(documentation \"https://{{ github_username }}.github.io/{{ project_slug }}/\"){% endif %}\n\n{% if github_username %}(source\n (github {{ github_username }}/{{ project_slug }})){% endif %}\n\n(license ISC)\n\n(authors\n \"{{ author_name }}{% if author_email %} <{{ author_email }}>{% endif %}\")\n\n(maintainers\n \"{{ author_name }}{% if author_email %} <{{ author_email }}>{% endif %}\")\n\n(generate_opam_files true)\n\n(package\n (name {{ project_slug }})\n (synopsis \"{{ project_description }}\")\n (description \"{{ project_description }}\")\n (depends\n (ocaml (>= 4.08.0))\n dune\n {%- if test_framework == 'Alcotest' %}\n (alcotest :with-test)\n {%- endif %}\n (odoc :with-doc)))\n"
let d_19be71cf8e481a8a7c188d8ba64f37a6 = "let greet name = \"Hello \" ^ name ^ \"!\"\n"
let d_1da0d31c24f620257c6f5b9b01fd8ff1 = "# {{ project_name }}\n\n{%- if ci_cd == 'Github' and github_username %}\n\n[](https://github.com/{{ github_username }}/{{ project_slug }}/actions)\n{%- endif %}\n\n{%- if project_description %}\n\n{{ project_description }}\n{%- endif %}\n\n## Contributing\n\nTake a look at our [Contributing Guide](CONTRIBUTING.md).\n"
let d_5514c79426ac805d4ce99f659478ddec = ".DEFAULT_GOAL := all\n\nARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))\n$(eval $(ARGS):;@:)\n\n.PHONY: all\nall:\n\topam exec -- dune build --root . @install\n\n.PHONY: deps\ndeps: ## Install development dependencies\n\topam install -y dune-release ocamlformat utop ocaml-lsp-server\n\topam install --deps-only --with-test --with-doc -y .\n\n.PHONY: create_switch\ncreate_switch: ## Create an opam switch without any dependency\n\topam switch create . --no-install -y\n\n.PHONY: switch\nswitch: ## Create an opam switch and install development dependencies\n\topam install . --deps-only --with-doc --with-test\n\topam install -y dune-release ocamlformat utop ocaml-lsp-server\n\n.PHONY: lock\nlock: ## Generate a lock file\n\topam lock -y .\n\n.PHONY: build\nbuild: ## Build the project, including non installable libraries and executables\n\topam exec -- dune build --root .\n\n.PHONY: install\ninstall: all ## Install the packages on the system\n\topam exec -- dune install --root .\n\n.PHONY: start\nstart: all ## Run the produced executable\n\topam exec -- dune exec --root . bin/main.exe $(ARGS)\n\n.PHONY: test\ntest: ## Run the unit tests\n\topam exec -- dune runtest --root .\n\n.PHONY: clean\nclean: ## Clean build artifacts and other generated files\n\topam exec -- dune clean --root .\n\n.PHONY: doc\ndoc: ## Generate odoc documentation\n\topam exec -- dune build --root . @doc\n\n.PHONY: servedoc\nservedoc: doc ## Open odoc documentation with default web browser\n\topen _build/default/_doc/_html/index.html\n\n.PHONY: fmt\nfmt: ## Format the codebase with ocamlformat\n\topam exec -- dune build --root . --auto-promote @fmt\n\n.PHONY: watch\nwatch: ## Watch for the filesystem and rebuild on every change\n\topam exec -- dune build --root . --watch\n\n.PHONY: utop\nutop: ## Run a REPL and link with the project's libraries\n\topam exec -- dune utop --root . lib -- -implicit-bindings\n\n.PHONY: release\nrelease: all ## Run the release script \n\topam exec -- dune-release tag\n\topam exec -- dune-release distrib\n\topam exec -- dune-release publish distrib -y\n\topam exec -- dune-release opam pkg\n\topam exec -- dune-release opam submit --no-auto-open -y\n"
let d_616e18a47e59913c3ba615fd13a059c4 = "(library\n (name {{ project_snake }})\n (public_name {{ project_slug }})\n (libraries))\n"
let d_61ac0dabc62af3ecab157288d2d157d5 = "(executable\n (name main)\n (public_name {{ project_slug }})\n (libraries {{ project_slug }}))\n"
let d_63ea16779610788796be5454d433058e = "# This file is generated by dune, edit dune-project instead\nopam-version: \"2.0\"\nsynopsis: \"{{ project_description }}\"\ndescription: \"\"\"\n{{ project_description }}\n\"\"\"\nmaintainer: [\"{{ author_name }}{% if author_email %} <{{ author_email }}>{% endif %}\"]\nauthors: [\"{{ author_name }}{% if author_email %} <{{ author_email }}>{% endif %}\"]\nlicense: \"ISC\"\n{%- if github_username %}\nhomepage: \"https://github.com/{{ github_username }}/{{ project_slug }}\"\ndoc: \"https://{{ github_username }}.github.io/{{ project_slug }}\"\nbug-reports: \"https://github.com/{{ github_username }}/{{ project_slug }}/issues\"{% endif %}\ndepends: [\n \"ocaml\" {>= \"4.08.0\"}\n \"dune\" {>= \"2.0\"}\n {% if test_framework == 'Alcotest' -%}\n \"alcotest\" {with-test}\n {% endif -%}\n \"odoc\" {with-doc}\n]\nbuild: [\n [\"dune\" \"subst\"] {dev}\n [\n \"dune\"\n \"build\"\n \"-p\"\n name\n \"-j\"\n jobs\n \"@install\"\n \"@runtest\" {with-test}\n \"@doc\" {with-doc}\n ]\n]\n{%- if github_username %}\ndev-repo: \"git+https://github.com/{{ github_username }}/{{ project_slug }}.git\"{% endif %}\n"
let d_7b64256a4dfd967c785e64f866e1b123 = "(** {{ project_description }} *)\n\nval greet : string -> string\n(** Returns a greeting message.\n\n {4 Examples}\n\n {[ print_endline @@ greet \"Jane\" ]} *)\n"
let d_7e536236faf7138ba13470a237367e9d = "# bin\n\nNative project containing a binary.\n\n```bash\nspin new bin\n```\n"
let d_acb015e049f3c9977cc516548e7c8e94 = "name: CI\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\n{% raw -%}\njobs:\n build-and-test:\n strategy:\n fail-fast: false\n\n matrix:\n os:\n - macos-latest\n - ubuntu-latest\n - windows-latest\n\n ocaml-compiler:\n - 4.12.x\n\n runs-on: ${{ matrix.os }}\n\n steps:\n\n - name: Checkout code\n uses: actions/checkout@v2\n\n - name: Use OCaml ${{ matrix.ocaml-compiler }}\n uses: ocaml/setup-ocaml@v2\n with:\n ocaml-compiler: ${{ matrix.ocaml-compiler }}\n dune-cache: ${{ matrix.os != 'macos-latest' }}\n\n - name: Install ocamlformat\n run: opam install ocamlformat.0.18.0\n if: ${{ matrix.os == 'ubuntu-latest' }}\n\n - name: Install opam packages\n run: opam install . --with-test\n\n - name: Check formatting\n run: make fmt\n if: ${{ matrix.os == 'ubuntu-latest' && always() }}\n\n - name: Run build\n run: make build\n\n - name: Run the unit tests\n run: make test\n timeout-minutes: 1\n{%- endraw %}\n"
let d_ade3f87309240b9f5a93fea5c37972e9 = "open Alcotest\n\nlet test_hello_with_name name () =\n let greeting = {{ project_snake | capitalize }}.greet name in\n let expected = \"Hello \" ^ name ^ \"!\" in\n check string \"same string\" greeting expected\n\nlet suite =\n [ \"can greet Tom\", `Quick, test_hello_with_name \"Tom\"\n ; \"can greet John\", `Quick, test_hello_with_name \"John\"\n ]\n\nlet () =\n Alcotest.run \"{{ project_slug }}\" [ \"{{ project_snake | capitalize }}\", suite ]\n"
let d_b44cc1ce96dff37bdd503ffc27ed39b8 = "(tests\n (names {{ project_snake }}_test)\n (package {{ project_slug }})\n (libraries alcotest {{ project_snake }}))\n"
let d_cb74b2f81c98c660b2fd02982bd406ed = "# Contributing\n\n## Setup your development environment\n\nYou need Opam, you can install it by following [Opam's documentation](https://opam.ocaml.org/doc/Install.html).\n\nWith Opam installed, you can install the dependencies in a new local switch with:\n\n```bash\nmake switch\n```\n\nOr globally, with:\n\n```bash\nmake deps\n```\n\nThen, build the project with:\n\n```bash\nmake build\n```\n\n### Running Binary\n\nAfter building the project, you can run the main binary that is produced.\n\n```bash\nmake start\n```\n\n### Running Tests\n\nYou can run the test compiled executable:\n\n```bash\nmake test\n```\n\n### Building documentation\n\nDocumentation for the libraries in the project can be generated with:\n\n```bash\nmake doc\nmake servedoc\n```\n\n### Repository Structure\n\nThe following snippet describes {{ project_name }}'s repository structure.\n\n```text\n.\n\226\148\156\226\148\128\226\148\128 bin/\n| Source for {{ project_slug }}'s binary. This links to the library defined in `lib/`.\n\226\148\130\n\226\148\156\226\148\128\226\148\128 lib/\n| Source for {{ project_name }}'s library. Contains {{ project_name }}'s core functionnalities.\n\226\148\130\n\226\148\156\226\148\128\226\148\128 test/\n| Unit tests and integration tests for {{ project_name }}.\n\226\148\130\n\226\148\156\226\148\128\226\148\128 dune-project\n| Dune file used to mark the root of the project and define project-wide parameters.\n| For the documentation of the syntax, see https://dune.readthedocs.io/en/stable/dune-files.html#dune-project\n\226\148\130\n\226\148\156\226\148\128\226\148\128 LICENSE\n\226\148\130\n\226\148\156\226\148\128\226\148\128 Makefile\n| Make file containing common development command.\n\226\148\130\n\226\148\156\226\148\128\226\148\128 README.md\n\226\148\130\n\226\148\148\226\148\128\226\148\128 {{ project_slug }}.opam\n Opam package definition.\n To know more about creating and publishing opam packages, see https://opam.ocaml.org/doc/Packaging.html.\n```\n"
let d_d171486544dcbe78f38c1a38010b058d = "(** Main entry point for our application. *)\n"
let d_d524ff976af0bb15d69adb6fa5a9e521 = "# Dune generated files\n_build/\n*.install\n\n# Merlin configuring file for Vim and Emacs\n.merlin\n\n# Local OPAM switch\n_opam/\n"
let d_d54e9e5826cf13ca9ab83d620b03931d = "(** Main entry point for our application. *)\n\nlet () = print_endline @@ {{ project_snake | capitalize }}.greet \"World\"\n"
let d_da8e0855c0c03e58d71dbf0d26588439 = "(env\n (dev\n (flags\n (:standard -w +A-48-42-44 -warn-error +A-3))))\n"
let d_dd36b2beb4dbe80294297e098c1fa97a = "version = 0.18.0\nprofile = conventional\nparse-docstrings = true\nwrap-comments = true\n"
let d_df08db0da95054d5b2418f8d90f5a615 = "(name bin)\n(description \"Native project containing a binary\")\n\n(config project_name\n (input (prompt \"Project name\")))\n\n(config project_slug\n (input (prompt \"Project slug\"))\n (default (slugify :project_name))\n (rules\n (\"The project slug must be lowercase and contain ASCII characters and '-' only.\"\n (eq :project_slug (slugify :project_slug)))))\n\n(config project_snake\n (default (snake_case :project_slug)))\n\n(config create_switch\n (default true))\n\n(config project_description\n (input (prompt \"Description\"))\n (default \"A short, but powerful statement about your project\")\n (rules\n (\"The last character of the description cannot be a \\\".\\\" to comply with Opam\"\n (neq . (last_char :project_description)))))\n\n(config author_name\n (input (prompt \"Name of the author\")))\n\n(config test_framework\n (select\n (prompt \"Which test framework do you prefer?\")\n (values Alcotest None))\n (default Alcotest))\n\n(config ci_cd\n (select\n (prompt \"Which CI/CD do you use?\")\n (values Github None))\n (default Github))\n\n(ignore \n (files test/*)\n (enabled_if (eq :test_framework None)))\n\n(ignore\n (files github/*)\n (enabled_if (neq :ci_cd Github)))\n\n; We need to do this because Dune won't copy .github during build\n(post_gen\n (actions\n (run mv github .github))\n (enabled_if (eq :ci_cd Github)))\n\n(post_gen\n (actions\n (run make create_switch)\n (run make deps)\n (run make build))\n (message \"\240\159\142\129 Installing packages in a switch. This might take a couple minutes.\")\n (enabled_if (eq :create_switch true)))\n\n(post_gen\n (actions\n (run make deps)\n (run make build))\n (message \"\240\159\142\129 Installing packages globally. This might take a couple minutes.\")\n (enabled_if (eq :create_switch false)))\n\n(example_commands\n (commands\n (\"make deps\" \"Download runtime and development dependencies.\")\n (\"make build\" \"Build the dependencies and the project.\")\n (\"make test\" \"Starts the test runner.\")))\n"
let d_f2e127cfcc68ebbc43030554c0845163 = "ISC License\n\nCopyright (c) 2021 {{ author_name }}\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\nWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\nMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\nANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\nWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\nACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\nOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE."
let file_chunks = function
| "README.md" | "/README.md" -> Some [ d_7e536236faf7138ba13470a237367e9d; ]
| "spin" | "/spin" -> Some [ d_df08db0da95054d5b2418f8d90f5a615; ]
| "template/.gitignore" | "/template/.gitignore" -> Some [ d_d524ff976af0bb15d69adb6fa5a9e521; ]
| "template/.ocamlformat" | "/template/.ocamlformat" -> Some [ d_dd36b2beb4dbe80294297e098c1fa97a; ]
| "template/CHANGES.md" | "/template/CHANGES.md" -> Some [ d_132072893c4898750d2418b319b29683; ]
| "template/CONTRIBUTING.md" | "/template/CONTRIBUTING.md" -> Some [ d_cb74b2f81c98c660b2fd02982bd406ed; ]
| "template/LICENSE" | "/template/LICENSE" -> Some [ d_f2e127cfcc68ebbc43030554c0845163; ]
| "template/Makefile" | "/template/Makefile" -> Some [ d_5514c79426ac805d4ce99f659478ddec; ]
| "template/README.md" | "/template/README.md" -> Some [ d_1da0d31c24f620257c6f5b9b01fd8ff1; ]
| "template/bin/dune" | "/template/bin/dune" -> Some [ d_61ac0dabc62af3ecab157288d2d157d5; ]
| "template/bin/main.ml" | "/template/bin/main.ml" -> Some [ d_d54e9e5826cf13ca9ab83d620b03931d; ]
| "template/bin/main.mli" | "/template/bin/main.mli" -> Some [ d_d171486544dcbe78f38c1a38010b058d; ]
| "template/dune" | "/template/dune" -> Some [ d_da8e0855c0c03e58d71dbf0d26588439; ]
| "template/dune-project" | "/template/dune-project" -> Some [ d_15099a7cbce53724579df6a8d911be0b; ]
| "template/github/workflows/ci.yml" | "/template/github/workflows/ci.yml" -> Some [ d_acb015e049f3c9977cc516548e7c8e94; ]
| "template/lib/dune" | "/template/lib/dune" -> Some [ d_616e18a47e59913c3ba615fd13a059c4; ]
| "template/lib/{{ project_snake }}.ml" | "/template/lib/{{ project_snake }}.ml" -> Some [ d_19be71cf8e481a8a7c188d8ba64f37a6; ]
| "template/lib/{{ project_snake }}.mli" | "/template/lib/{{ project_snake }}.mli" -> Some [ d_7b64256a4dfd967c785e64f866e1b123; ]
| "template/test/dune" | "/template/test/dune" -> Some [ d_b44cc1ce96dff37bdd503ffc27ed39b8; ]
| "template/test/{{ project_snake }}_test.ml" | "/template/test/{{ project_snake }}_test.ml" -> Some [ d_ade3f87309240b9f5a93fea5c37972e9; ]
| "template/{{ project_slug }}.opam" | "/template/{{ project_slug }}.opam" -> Some [ d_63ea16779610788796be5454d433058e; ]
| _ -> None
let file_list = [ "README.md"; "spin"; "template/.gitignore"; "template/.ocamlformat"; "template/CHANGES.md"; "template/CONTRIBUTING.md"; "template/LICENSE"; "template/Makefile"; "template/README.md"; "template/bin/dune"; "template/bin/main.ml"; "template/bin/main.mli"; "template/dune"; "template/dune-project"; "template/github/workflows/ci.yml"; "template/lib/dune"; "template/lib/{{ project_snake }}.ml"; "template/lib/{{ project_snake }}.mli"; "template/test/dune"; "template/test/{{ project_snake }}_test.ml"; "template/{{ project_slug }}.opam"; ]
end
let file_list = Internal.file_list
let read name =
match Internal.file_chunks name with
| None -> None
| Some c -> Some (String.concat "" c)
let hash = function
| "README.md" | "/README.md" -> Some "7e536236faf7138ba13470a237367e9d"
| "spin" | "/spin" -> Some "df08db0da95054d5b2418f8d90f5a615"
| "template/.gitignore" | "/template/.gitignore" -> Some "d524ff976af0bb15d69adb6fa5a9e521"
| "template/.ocamlformat" | "/template/.ocamlformat" -> Some "dd36b2beb4dbe80294297e098c1fa97a"
| "template/CHANGES.md" | "/template/CHANGES.md" -> Some "132072893c4898750d2418b319b29683"
| "template/CONTRIBUTING.md" | "/template/CONTRIBUTING.md" -> Some "cb74b2f81c98c660b2fd02982bd406ed"
| "template/LICENSE" | "/template/LICENSE" -> Some "f2e127cfcc68ebbc43030554c0845163"
| "template/Makefile" | "/template/Makefile" -> Some "5514c79426ac805d4ce99f659478ddec"
| "template/README.md" | "/template/README.md" -> Some "1da0d31c24f620257c6f5b9b01fd8ff1"
| "template/bin/dune" | "/template/bin/dune" -> Some "61ac0dabc62af3ecab157288d2d157d5"
| "template/bin/main.ml" | "/template/bin/main.ml" -> Some "d54e9e5826cf13ca9ab83d620b03931d"
| "template/bin/main.mli" | "/template/bin/main.mli" -> Some "d171486544dcbe78f38c1a38010b058d"
| "template/dune" | "/template/dune" -> Some "da8e0855c0c03e58d71dbf0d26588439"
| "template/dune-project" | "/template/dune-project" -> Some "15099a7cbce53724579df6a8d911be0b"
| "template/github/workflows/ci.yml" | "/template/github/workflows/ci.yml" -> Some "acb015e049f3c9977cc516548e7c8e94"
| "template/lib/dune" | "/template/lib/dune" -> Some "616e18a47e59913c3ba615fd13a059c4"
| "template/lib/{{ project_snake }}.ml" | "/template/lib/{{ project_snake }}.ml" -> Some "19be71cf8e481a8a7c188d8ba64f37a6"
| "template/lib/{{ project_snake }}.mli" | "/template/lib/{{ project_snake }}.mli" -> Some "7b64256a4dfd967c785e64f866e1b123"
| "template/test/dune" | "/template/test/dune" -> Some "b44cc1ce96dff37bdd503ffc27ed39b8"
| "template/test/{{ project_snake }}_test.ml" | "/template/test/{{ project_snake }}_test.ml" -> Some "ade3f87309240b9f5a93fea5c37972e9"
| "template/{{ project_slug }}.opam" | "/template/{{ project_slug }}.opam" -> Some "63ea16779610788796be5454d433058e"
| _ -> None
let size = function
| "README.md" | "/README.md" -> Some 69
| "spin" | "/spin" -> Some 1938
| "template/.gitignore" | "/template/.gitignore" -> Some 122
| "template/.ocamlformat" | "/template/.ocamlformat" -> Some 85
| "template/CHANGES.md" | "/template/CHANGES.md" -> Some 50
| "template/CONTRIBUTING.md" | "/template/CONTRIBUTING.md" -> Some 1655
| "template/LICENSE" | "/template/LICENSE" -> Some 747
| "template/Makefile" | "/template/Makefile" -> Some 2095
| "template/README.md" | "/template/README.md" -> Some 404
| "template/bin/dune" | "/template/bin/dune" -> Some 92
| "template/bin/main.ml" | "/template/bin/main.ml" -> Some 119
| "template/bin/main.mli" | "/template/bin/main.mli" -> Some 45
| "template/dune" | "/template/dune" -> Some 70
| "template/dune-project" | "/template/dune-project" -> Some 732
| "template/github/workflows/ci.yml" | "/template/github/workflows/ci.yml" -> Some 1093
| "template/lib/dune" | "/template/lib/dune" -> Some 85
| "template/lib/{{ project_snake }}.ml" | "/template/lib/{{ project_snake }}.ml" -> Some 39
| "template/lib/{{ project_snake }}.mli" | "/template/lib/{{ project_snake }}.mli" -> Some 157
| "template/test/dune" | "/template/test/dune" -> Some 114
| "template/test/{{ project_snake }}_test.ml" | "/template/test/{{ project_snake }}_test.ml" -> Some 426
| "template/{{ project_slug }}.opam" | "/template/{{ project_slug }}.opam" -> Some 1050
| _ -> None