Skip to content

Commit

Permalink
Split drom-share into another directory
Browse files Browse the repository at this point in the history
Add options in `drom.toml`:
[project]
share-repo = ".." # URL of drom-share repo to use
share-version = ".." # Version of drom-share repo to use

Allow projects to keep a specific version of `drom-share` even
when `drom` versions are changing.

Users can specify their own drom-share repo with user-contributed
skeletons and licenses.

Also: remove duplicate code of call.ml from misc.ml
  • Loading branch information
lefessan committed Mar 10, 2023
1 parent a392166 commit 292a917
Show file tree
Hide file tree
Showing 247 changed files with 1,774 additions and 5,638 deletions.
48 changes: 29 additions & 19 deletions .drom
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Keep this file in your GIT repo to help drom track generated files
# begin version
version:0.8.0
version:0.9.0
# end version

# hash of toml configuration files
# used for generation of all files
8afa290241b8702b433a9afa81f150c1:.
6754bc6a4636d1b08e494d6dd5babc85:.
# end context for .

# begin context for .github/workflows/workflow.yml
# file .github/workflows/workflow.yml
4e451e2c97c685e0d1e5a7617d2df8b7:.github/workflows/workflow.yml
17379dd384713dc356e0f1f47b7de18b:.github/workflows/workflow.yml
# end context for .github/workflows/workflow.yml

# begin context for .gitignore
Expand All @@ -25,7 +25,7 @@ version:0.8.0

# begin context for .ocamlformat-ignore
# file .ocamlformat-ignore
892b3a237f9064adbe81b078237b4b5c:.ocamlformat-ignore
23e7663a5c08ffd7ab0939fb31cc1a26:.ocamlformat-ignore
# end context for .ocamlformat-ignore

# begin context for .ocp-indent
Expand All @@ -50,7 +50,7 @@ version:0.8.0

# begin context for README.md
# file README.md
5d523350230459e853bc57803b729e29:README.md
616ddd2660258447be65bdb664b9241d:README.md
# end context for README.md

# begin context for docs/README.txt
Expand All @@ -70,7 +70,7 @@ e739f3026aa997af4026bc428f4c9ef6:docs/favicon.png

# begin context for docs/index.html
# file docs/index.html
b9a0f9e7e370fe84b6e7d3e90ceb9ba4:docs/index.html
bcb6c1bfa1c947810ef639238ec42ddd:docs/index.html
# end context for docs/index.html

# begin context for docs/sphinx/index.html
Expand All @@ -90,32 +90,32 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css

# begin context for drom.toml
# file drom.toml
b475b0b0637472408fe198f106595d9e:drom.toml
800217989c2927eba8feb4b5129d1433:drom.toml
# end context for drom.toml

# begin context for dune
# file dune
b9f2c87e2fd71a152b79fac4a7ba7c8e:dune
e850a13c004f963e9f5a568eac93c217:dune
# end context for dune

# begin context for dune-project
# file dune-project
4b3d6ef1eb76e10c9551edd620f5e19e:dune-project
896bcabb3e1e7b731d8c99b81453fe64:dune-project
# end context for dune-project

# begin context for opam/drom.opam
# file opam/drom.opam
0b787578e0a8e491132bf269bc32c56b:opam/drom.opam
82e08bc39e2a458b83f5e64735049fc8:opam/drom.opam
# end context for opam/drom.opam

# begin context for opam/drom_lib.opam
# file opam/drom_lib.opam
19c19bb314845c46214ef15ecf119a0d:opam/drom_lib.opam
c536a1a9215f8e1278fe2ecf7e676894:opam/drom_lib.opam
# end context for opam/drom_lib.opam

# begin context for opam/drom_toml.opam
# file opam/drom_toml.opam
68a1705efeab2682315f5d3eca7ee3b4:opam/drom_toml.opam
b9072779a9af16807805ad8ca759c967:opam/drom_toml.opam
# end context for opam/drom_toml.opam

# begin context for scripts/after.sh
Expand All @@ -133,6 +133,11 @@ b9f2c87e2fd71a152b79fac4a7ba7c8e:dune
bb3a9d286f0dc64021db4194427263ee:scripts/copy-bin.sh
# end context for scripts/copy-bin.sh

# begin context for scripts/static-build.sh
# file scripts/static-build.sh
2a405479b3313d79d421c2e7fc282304:scripts/static-build.sh
# end context for scripts/static-build.sh

# begin context for sphinx/_static/css/fixes.css
# file sphinx/_static/css/fixes.css
68b329da9893e34099c7d8ad5cb9c940:sphinx/_static/css/fixes.css
Expand Down Expand Up @@ -165,27 +170,32 @@ dc4cee7810778bedcd7b9bfa95338ac4:sphinx/conf.py

# begin context for src/drom/dune
# file src/drom/dune
b2467739c3fd8542338ce53133b3fefd:src/drom/dune
efad88968955023a354f16469eb1ae15:src/drom/dune
# end context for src/drom/dune

# begin context for src/drom/index.mld
# file src/drom/index.mld
2818d15f527a37c2cfafe85ef89f675b:src/drom/index.mld
# end context for src/drom/index.mld

# begin context for src/drom/linking_flags.sh
# file src/drom/linking_flags.sh
0a2fe9095ac85798a954cea4a04944b7:src/drom/linking_flags.sh
# end context for src/drom/linking_flags.sh

# begin context for src/drom/main.ml
# file src/drom/main.ml
814f119d7d67ab5ba390f38510a4aff8:src/drom/main.ml
# end context for src/drom/main.ml

# begin context for src/drom/package.toml
# file src/drom/package.toml
a4a604d4740d5f79a02ee3acdaae14f6:src/drom/package.toml
5bdfaa2663247cad045abb018d576a5e:src/drom/package.toml
# end context for src/drom/package.toml

# begin context for src/drom_lib/dune
# file src/drom_lib/dune
00e1984908cd2d51ca87929d9e2aef80:src/drom_lib/dune
e7ddb8c3da7d7b47c8100964303ba50a:src/drom_lib/dune
# end context for src/drom_lib/dune

# begin context for src/drom_lib/index.mld
Expand All @@ -195,12 +205,12 @@ a4a604d4740d5f79a02ee3acdaae14f6:src/drom/package.toml

# begin context for src/drom_lib/package.toml
# file src/drom_lib/package.toml
13986788a940f2b0d60f974aaf70f334:src/drom_lib/package.toml
18ae084348cbfdbb80ca1469113e0e9f:src/drom_lib/package.toml
# end context for src/drom_lib/package.toml

# begin context for src/drom_lib/version.mlt
# file src/drom_lib/version.mlt
959d160d86aff863e3d46e620d4c23f0:src/drom_lib/version.mlt
a5546648c9940d7c1f223cbc12e0ffbb:src/drom_lib/version.mlt
# end context for src/drom_lib/version.mlt

# begin context for src/toml.7.1.0/dune
Expand All @@ -220,12 +230,12 @@ d1b05207fce876a1b44a8b268bcaf226:src/toml.7.1.0/index.mld

# begin context for src/toml.7.1.0/package.toml
# file src/toml.7.1.0/package.toml
986791b406c5a9f90d24301860a2f5e5:src/toml.7.1.0/package.toml
706b170edac8a3051745f05ece52fb62:src/toml.7.1.0/package.toml
# end context for src/toml.7.1.0/package.toml

# begin context for src/toml.7.1.0/version.mlt
# file src/toml.7.1.0/version.mlt
959d160d86aff863e3d46e620d4c23f0:src/toml.7.1.0/version.mlt
a5546648c9940d7c1f223cbc12e0ffbb:src/toml.7.1.0/version.mlt
# end context for src/toml.7.1.0/version.mlt

# begin context for test/expect-tests/dune
Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Main Workflow

# use fields.git-main-branch to change from master
on:
pull_request:
branches:
Expand Down Expand Up @@ -30,6 +31,8 @@ jobs:

runs-on: ${{ matrix.os }}

# use fields.github-workflow-env to add something here

steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -55,7 +58,7 @@ jobs:
git config --global user.name github-actions
git config --global user.email [email protected]
# define opam-repo = "git+https://" to add an extra opam repo
# use fields.opam-repo = "git+https://" to add an 'extra' opam repository

- run: opam pin add . -y --no-action

Expand All @@ -65,21 +68,28 @@ jobs:
- run: opam install -y opam/*.opam --deps-only --with-test
# if: steps.cache-opam.outputs.cache-hit != 'true'

# - run: opam upgrade --fixup
# - run: opam upgrade --fixup
# if: steps.cache-opam.outputs.cache-hit == 'true'

- run: dos2unix scripts/*.sh
# Use fields.build-scripts to add more scripts to convert here
- run: dos2unix scripts/*.sh
if: matrix.os == 'windows-latest'

# Use fields.github-workflow-before-build to add something here

- run: make build

# Use fields.github-workflow-after-build to add something here

- name: run test suite
run: |
./scripts/before.sh test
opam exec -- dune build @runtest
./scripts/after.sh test
if: matrix.skip_test != 'true'

# Use fields.github-workflow-after-test to add something here

- name: test source is well formatted
run: make fmt
continue-on-error: true
Expand All @@ -103,3 +113,6 @@ jobs:
BRANCH: gh-pages
FOLDER: _drom/docs/
CLEAN: true

# Use fields.github-workflow-trailer to add a trailer here

2 changes: 1 addition & 1 deletion .ocamlformat-ignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
vendor/**
src/drom_lib/share/**


45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,48 @@ will generate files for Github Actions CI and Github pages.
* General Documentation: https://ocamlpro.github.io/drom/sphinx
* API Documentation: https://ocamlpro.github.io/drom/doc
* Sources: https://github.com/ocamlpro/drom


## Simple Example

You can create a new OCaml project with:

```
$ drom new my-client --skeleton mini_prg
Creating project "my-client" with skeleton "mini_prg", license "LGPL2"
and sources in src/my-client:
Creating directory my-client
Using skeleton "program" for package "my-client"
[master (root-commit) 8d83262] Initial commit
└── my-client/
├── .drom (drom state, do not edit)
├── .github/
│ └── workflows/
│ └── workflow.yml
├── .gitignore
├── CHANGES.md
├── LICENSE.md
├── Makefile
├── README.md
├── drom.toml <────────── project config EDIT !
├── dune
├── dune-project
├── opam/
│ └── my-client.opam
├── scripts/
│ ├── after.sh
│ ├── before.sh
│ └── copy-bin.sh
└── src/
└── my-client/
├── dune
├── main.ml
├── package.toml <────────── package config EDIT !
└── version.mlt
```

This project uses the minimalist `mini_prg` skeleton, but other skeletons
like `program` or `library` have more files.


42 changes: 41 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>drom</title>
<link rel="stylesheet" href="style.css?v=5d7320a9a8657af61f899c84ec3bdcb7"/>
<link rel="stylesheet" href="style.css?v=1eb62145308aed80e0f86b959d6f7fd0"/>
<link rel="icon" type="image/png" sizes="804x804" href="favicon.png" />
</head>
<body>
Expand All @@ -30,6 +30,46 @@ <h1>drom</h1>
<p>Authors:</p>
<ul> <li><p>Fabrice Le Fessant &lt;fabrice.le_fessant&commat;origin-labs.com&gt;</p></li>
<li><p>Léo Andrès &lt;leo.andres&commat;ocamlpro.com&gt;</p></li></ul>
</div>
<div class="section">
<h2 id="simple-example">Simple Example</h2>
<p>You can create a new OCaml project with:</p>
<pre><code>$ drom new my-client --skeleton mini_prg
Creating project &quot;my-client&quot; with skeleton &quot;mini_prg&quot;, license &quot;LGPL2&quot;
and sources in src/my-client:
Creating directory my-client
Using skeleton &quot;program&quot; for package &quot;my-client&quot;
[master (root-commit) 8d83262] Initial commit

└── my-client/
├── .drom (drom state, do not edit)
├── .github/
│ └── workflows/
│ └── workflow.yml
├── .gitignore
├── CHANGES.md
├── LICENSE.md
├── Makefile
├── README.md
├── drom.toml &lt;────────── project config EDIT !
├── dune
├── dune-project
├── opam/
│ └── my-client.opam
├── scripts/
│ ├── after.sh
│ ├── before.sh
│ └── copy-bin.sh
└── src/
└── my-client/
├── dune
├── main.ml
├── package.toml &lt;────────── package config EDIT !
└── version.mlt
</code></pre>
<p>This project uses the minimalist <code>mini_prg</code> skeleton, but other skeletons
like <code>program</code> or <code>library</code> have more files.</p>

</div>
<div class="trailer">
<hr/>
Expand Down
Loading

0 comments on commit 292a917

Please sign in to comment.