Skip to content

Commit 9dfbb2b

Browse files
author
Fabrice Le Fessant
committed
Improve skeletons
1 parent a0af81f commit 9dfbb2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2191
-1587
lines changed

.drom

Lines changed: 39 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,40 @@
11
# Keep this file in your GIT repo to help drom track generated files
2-
ac2aab1d8f78befbbfca730668f71e8d .github/workflows/ci.ml
3-
a7863667f1da4a1284e533e6919cdce3 .github/workflows/workflow.yml
4-
4545d6f4a7e1902e0f4f56112134548b .gitignore
5-
4cb1bae128d8e649654a5828aaf3e0f9 .gitignore2
6-
be2d226b0dc658a425e86af1847a2316 .ocamlformat
7-
5574462426a3706b11f5cbdbb0d4ad91 .ocamlformat-ignore
8-
1281376e351d6c2be9ea4c576a29ebd4 .ocp-indent
9-
7a038eccc259630a7aaa876eceb826ba CHANGES.md
10-
3490cfc0aa14b8da56f1a05329374b43 LICENSE.md
11-
118525fb5ba6186eedb505bbc7cd9a9c Makefile
12-
b091dd96e8b553dd7a7df285279d7d9e README.md
13-
8be75c8edbcba1b202a77111dda43d0c _drom/test
14-
22d2b3768a6ad00e859332cc4643e85b dir/output-tests/dune
15-
f0ef7081e1539ac00ef5b761b4fb01b3 dir/output-tests/test1.expected
16-
894dddf3304cbcb0fe04f7c2bbd56073 dir/output-tests/test2.expected
17-
0f462df2b69093bbe70ed1e7f9fd0ac6 dir/output-tests/test2.ml
18-
d41d8cd98f00b204e9800998ecf8427e docs/.nojekyll
19-
8c90147085379063e18134a7f18f079b docs/doc/index.html
20-
c352caa74812a7a09cdd3e52031d6033 docs/index.html
21-
8a2ddf0ce1706457ec54652cf0f5ffac docs/sphinx/index.html
22-
a95f1ab7d178b468eff6188a527535d9 docs/style.css
23-
30281c0f416f7fa965c21b066d27eb2c drom-deps.opam
24-
bd59d8728576b564d779a35c4cab2b30 drom-lib.opam
25-
30281c0f416f7fa965c21b066d27eb2c drom-opam.deps
26-
2be6032b5de53fc74f1cf300bcf5ba67 drom.opam
27-
be9bce812c8fb84f1181a4465d5db382 drom.toml
28-
4af4aefc60cfb31ded96d242d76d2e5a drom_lib.opam
29-
f2ce6be777f5e6d83267aac5c4687b0e drom_lib2.opam
30-
97eadaa266cb426e18086dbf393d9951 dune
31-
e4c401c332554eaf0cf522d3dbed4735 dune-project
32-
9783fff1ee77833796e3b1e81bb07bba main/dune
33-
5a67f25edac115500b168ab38b3c7faf main/dune2
34-
d947d2a8c369bc5ff232874cc3b568ac main/index.mld
35-
ee5e7bde03148f6dcef8a75efa4fa83b main/main.ml
36-
5574462426a3706b11f5cbdbb0d4ad91 ocamlformat-ignore
37-
68b329da9893e34099c7d8ad5cb9c940 sphinx/UNDER_static/css/fixes.css
38-
d41d8cd98f00b204e9800998ecf8427e sphinx/_static/css/fixes.css
39-
a44c87f3a364dd95f55427fe40b2c5d1 sphinx/about.rst
40-
a27d8599880dce8b4833c38f89ccd6cf sphinx/conf.py
41-
31524abd666942907d4ff5e55f3d24b4 sphinx/index.rst
42-
35f7c2d1720a9af03823647787c53099 sphinx/install.rst
43-
6a086ec9f013f20864c7d019b0d634fe sphinx/license.rst
44-
5a67f25edac115500b168ab38b3c7faf src/drom/dune
45-
330455ff80dd6bbff00fe9da6576ab09 src/drom_lib/dune
46-
5995081f731bcce4893801234419852a src/drom_lib/dune2
47-
0ae0bb904b090c17249048a67a527ffb src/dune
48-
5bd0ab058432e0b47eb76a0ad12489bc src/dune2
49-
dfda02aaec08f18742582243e9cd6748 src/index.mld
50-
5a67f25edac115500b168ab38b3c7faf src/main/dune
51-
af27c1e3ba42bf604debde81955f1eeb src/main/dune2
52-
fab8224b1866cef1103bca89068b73fe src/version.ml
53-
cbc07c7ef25a01ae6c7ef10c559d3bd7 src2/dune
54-
bc93b0840d0f30f70e7c491d436a812a src2/index.mld
55-
8ca05f6f060c00d1bd3a34eec8f176dc src2/main.ml
56-
fab8224b1866cef1103bca89068b73fe src2/version.ml
57-
f15fedac6f43c154bcd0348b776ac08c test/expect-tests/dune
58-
16aa6d750c44bb58dc22a8c2a06d1534 test/expect-tests/test.ml
59-
75d7504f9c8002ec5ccdd2458f01da09 test/inline-tests/dune
60-
e001d04969100c711855223ad6c23e6a test/inline-tests/test.ml
61-
28db2068920c1259cbd67a7c322730ed test/output-tests/dune
62-
f0ef7081e1539ac00ef5b761b4fb01b3 test/output-tests/test1.expected
63-
894dddf3304cbcb0fe04f7c2bbd56073 test/output-tests/test2.expected
64-
704ff05ffd8b0e50716542fa55b2db8a test/output-tests/test2.ml
2+
e85b39194f20e462352c7e6bb1dde3b4:.
3+
a7863667f1da4a1284e533e6919cdce3:.github/workflows/workflow.yml
4+
4545d6f4a7e1902e0f4f56112134548b:.gitignore
5+
be2d226b0dc658a425e86af1847a2316:.ocamlformat
6+
5574462426a3706b11f5cbdbb0d4ad91:.ocamlformat-ignore
7+
1281376e351d6c2be9ea4c576a29ebd4:.ocp-indent
8+
7a038eccc259630a7aaa876eceb826ba:CHANGES.md
9+
c4217a22064a4a18f9587b930b250fbe:LICENSE.md
10+
118525fb5ba6186eedb505bbc7cd9a9c:Makefile
11+
b091dd96e8b553dd7a7df285279d7d9e:README.md
12+
8be75c8edbcba1b202a77111dda43d0c:_drom/test
13+
d41d8cd98f00b204e9800998ecf8427e:docs/.nojekyll
14+
8c90147085379063e18134a7f18f079b:docs/doc/index.html
15+
c352caa74812a7a09cdd3e52031d6033:docs/index.html
16+
8a2ddf0ce1706457ec54652cf0f5ffac:docs/sphinx/index.html
17+
a95f1ab7d178b468eff6188a527535d9:docs/style.css
18+
30281c0f416f7fa965c21b066d27eb2c:drom-opam.deps
19+
2be6032b5de53fc74f1cf300bcf5ba67:drom.opam
20+
a214da2770f27534d07f5a6120c5a742:drom.toml
21+
4af4aefc60cfb31ded96d242d76d2e5a:drom_lib.opam
22+
97eadaa266cb426e18086dbf393d9951:dune
23+
e4c401c332554eaf0cf522d3dbed4735:dune-project
24+
d41d8cd98f00b204e9800998ecf8427e:sphinx/_static/css/fixes.css
25+
a44c87f3a364dd95f55427fe40b2c5d1:sphinx/about.rst
26+
a27d8599880dce8b4833c38f89ccd6cf:sphinx/conf.py
27+
31524abd666942907d4ff5e55f3d24b4:sphinx/index.rst
28+
35f7c2d1720a9af03823647787c53099:sphinx/install.rst
29+
cf3f86e8f7d8e90e663c3cb7e438057d:sphinx/license.rst
30+
5a67f25edac115500b168ab38b3c7faf:src/drom/dune
31+
84f9ee00eede6c0e54dbfb5e1fc871e1:src/drom_lib/dune
32+
5995081f731bcce4893801234419852a:src/drom_lib/dune2
33+
f15fedac6f43c154bcd0348b776ac08c:test/expect-tests/dune
34+
16aa6d750c44bb58dc22a8c2a06d1534:test/expect-tests/test.ml
35+
75d7504f9c8002ec5ccdd2458f01da09:test/inline-tests/dune
36+
e001d04969100c711855223ad6c23e6a:test/inline-tests/test.ml
37+
28db2068920c1259cbd67a7c322730ed:test/output-tests/dune
38+
f0ef7081e1539ac00ef5b761b4fb01b3:test/output-tests/test1.expected
39+
894dddf3304cbcb0fe04f7c2bbd56073:test/output-tests/test2.expected
40+
704ff05ffd8b0e50716542fa55b2db8a:test/output-tests/test2.ml

.gitignore2

Lines changed: 0 additions & 10 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
How to contribute to drom ?
2+
===========================
3+
4+
There are many ways to contribute to drom. Here are a few starting
5+
points:
6+
7+
Adding support for a new tool/environement
8+
------------------------------------------
9+
10+
Suppose you think most OCaml projects should use a given tool. So, you
11+
may want to contribute support for this tool into projects generated
12+
by `drom`.
13+
14+
Here is how to do it:
15+
16+
* There are projects' skeletons in `src/drom_lib/skeletons/projects`,
17+
in particular the `virtual/` skeleton used as the basis for all
18+
other skeletons. You can add a new template file in that skeleton.
19+
Template files are used by substitutions of 3 kinds, !{EXPR},
20+
!(FIELD) and ![FLAG]. Have a look at other templates for examples.
21+
22+
* Once you have added a file in the skeleton, modify the
23+
`dune-trailer` field of the `drom_lib` package in `drom.toml` to add
24+
the new file as a dependency of the corresponding skeleton. You will
25+
need to call `drom project` to regenerate the `dune` file after
26+
every change.
27+
28+
* You may also want to add specific substitutions for your template
29+
file. This is done by modifying the project substitution
30+
`project_brace` in `src/drom_lib/subst.ml`.
31+
32+
Adding more known licenses
33+
--------------------------
34+
35+
Known licenses are included by scanning the `src/drom_lib/licenses/`
36+
directory. Have a look there for example. Every license is defined by:
37+
38+
* the name of its directory, which is the key used in the `license`
39+
field in `drom.toml`
40+
* a file `NAME` with the long name of the license
41+
* a file `HEADER` with the lines to add in the header of every source file
42+
* a file `LICENSE` with the complete text of the license
43+
44+
Once you have added a new license, edit the `dune-trailer` field in
45+
`drom.toml` to add the license files as dependencies (check where the
46+
other licenses appear). You will need to call `drom project` after
47+
that to regenerate the corresponding `dune` file.

LICENSE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Copyright (c) 2020 OCamlPro SAS & Origin Labs SAS
22

3-
43
This software is distributed under the terms of the
54
GNU Lesser General Public License (LGPL) version 2.1 (included below).
65

TODO

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
3+
* Utiliser les squelettes à la création du projet:
4+
* lookup du squelette
5+
* écriture avec substitution de certains champs
6+
* rechargement du projet
7+
8+
* Utiliser les squelettes à la création des packages:
9+
* lookup du squelette
10+
* écriture avec substitution de certains champs
11+
* rechargement du projet
12+
13+
* Ne pas écrire tant que tout n'a pas été calculé, permet d'éviter des
14+
erreurs avec un état partiel
15+
16+
* In the case where we share a global switch, pin the package.
17+
18+
* Générer la doc dans gh-pages depuis les github actions plutot que les
19+
pusher dans docs/
20+
21+
cargo build --release :
22+
dune build --profile xxx
23+
drom run -p xxx
24+
drom build -p xxx
25+
drom test -p xxx

drom.backup

4.66 MB
Binary file not shown.

drom.toml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ ocaml-flags = "-w +a-4-40-41-42-44"
5050
[profile.release]
5151
ocaml-flags = "-w -a"
5252
[project]
53+
generators = ["ocamllex", "menhir"]
5354
pack-modules = true
5455
skip-dirs = ["drom-test"]
5556

@@ -80,6 +81,8 @@ dune-trailer = """
8081
(rule
8182
(targets skel_project_virtual.ml)
8283
(deps
84+
skeletons/projects/virtual.toml
85+
8386
skeletons/projects/virtual/dot_ocp-indent
8487
skeletons/projects/virtual/dot_ocamlformat-ignore
8588
skeletons/projects/virtual/LICENSE.md
@@ -131,10 +134,21 @@ skeletons/projects/library.toml
131134
(with-stdout-to %{targets}
132135
(run skel_packer project library virtual skeletons/projects/library))))
133136
137+
(rule
138+
(targets skel_package_virtual.ml)
139+
(deps
140+
skeletons/packages/virtual.toml
141+
)
142+
(action
143+
(with-stdout-to %{targets}
144+
(run skel_packer package virtual None skeletons/packages/virtual))))
145+
134146
(rule
135147
(targets skel_package_program.ml)
136148
(deps
149+
skeletons/packages/program.toml
137150
skeletons/packages/program/dune
151+
skeletons/packages/program/main.ml
138152
)
139153
(action
140154
(with-stdout-to %{targets}
@@ -143,7 +157,9 @@ skeletons/projects/library.toml
143157
(rule
144158
(targets skel_package_library.ml)
145159
(deps
160+
skeletons/packages/library.toml
146161
skeletons/packages/library/dune
162+
skeletons/packages/library/main.ml
147163
)
148164
(action
149165
(with-stdout-to %{targets}
@@ -152,11 +168,41 @@ skeletons/projects/library.toml
152168
(rule
153169
(targets skel_package_driver.ml)
154170
(deps
171+
skeletons/packages/driver.toml
155172
skeletons/packages/driver/dune
173+
skeletons/packages/driver/main.ml
156174
)
157175
(action
158176
(with-stdout-to %{targets}
159177
(run skel_packer package driver None skeletons/packages/driver))))
160178
179+
(rule
180+
(targets skel_licenses.ml)
181+
(deps
182+
licenses/LGPL2/NAME
183+
licenses/LGPL2/HEADER
184+
licenses/LGPL2/LICENSE
185+
186+
licenses/GPL3/NAME
187+
licenses/GPL3/HEADER
188+
licenses/GPL3/LICENSE
189+
190+
licenses/BSD2/NAME
191+
licenses/BSD2/HEADER
192+
licenses/BSD2/LICENSE
193+
194+
licenses/BSD3/NAME
195+
licenses/BSD3/HEADER
196+
licenses/BSD3/LICENSE
197+
198+
licenses/ISC/NAME
199+
licenses/ISC/HEADER
200+
licenses/ISC/LICENSE
201+
)
202+
(action
203+
(with-stdout-to %{targets}
204+
(run skel_packer licenses))))
205+
161206
(data_only_dirs skeletons)
162207
"""
208+

log

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
Workspace root: /home/lefessan/GIT/ocp/public-github/drom
2+
Running[0]: /usr/bin/nproc > /tmp/dune05458a.output 2> /dev/null
3+
Auto-detected concurrency: 4
4+
disable binary cache
5+
Running[1]: /home/lefessan/.opam/4.07.1/bin/ocamlc.opt -config > /tmp/dune80f1d8.output
6+
Dune context:
7+
{ name = "default"
8+
; kind = "default"
9+
; profile = Dyn
10+
; merlin = true
11+
; for_host = None
12+
; fdo_target_exe = None
13+
; build_dir = "default"
14+
; toplevel_path = Some External "/home/lefessan/.opam/4.07.1/lib/toplevel"
15+
; ocaml_bin = External "/home/lefessan/.opam/4.07.1/bin"
16+
; ocaml = Ok External "/home/lefessan/.opam/4.07.1/bin/ocaml"
17+
; ocamlc = External "/home/lefessan/.opam/4.07.1/bin/ocamlc.opt"
18+
; ocamlopt = Ok External "/home/lefessan/.opam/4.07.1/bin/ocamlopt.opt"
19+
; ocamldep = Ok External "/home/lefessan/.opam/4.07.1/bin/ocamldep.opt"
20+
; ocamlmklib = Ok External "/home/lefessan/.opam/4.07.1/bin/ocamlmklib.opt"
21+
; env =
22+
map
23+
{ "INSIDE_DUNE" :
24+
"/home/lefessan/GIT/ocp/public-github/drom/_build/default"
25+
; "OCAMLFIND_IGNORE_DUPS_IN" :
26+
"/home/lefessan/GIT/ocp/public-github/drom/_build/install/default/lib"
27+
; "OCAMLPATH" :
28+
"/home/lefessan/GIT/ocp/public-github/drom/_build/install/default/lib"
29+
; "OCAMLTOP_INCLUDE_PATH" :
30+
"/home/lefessan/GIT/ocp/public-github/drom/_build/install/default/lib/toplevel"
31+
}
32+
; findlib_path = [ External "/home/lefessan/.opam/4.07.1/lib" ]
33+
; arch_sixtyfour = true
34+
; natdynlink_supported = true
35+
; supports_shared_libraries = true
36+
; ocaml_config =
37+
{ version = "4.07.1"
38+
; standard_library_default = "/home/lefessan/.opam/4.07.1/lib/ocaml"
39+
; standard_library = "/home/lefessan/.opam/4.07.1/lib/ocaml"
40+
; standard_runtime = "/home/lefessan/.opam/4.07.1/bin/ocamlrun"
41+
; ccomp_type = "cc"
42+
; c_compiler = "gcc"
43+
; ocamlc_cflags = [ "-O2"; "-fno-strict-aliasing"; "-fwrapv"; "-fPIC" ]
44+
; ocamlopt_cflags = [ "-O2"; "-fno-strict-aliasing"; "-fwrapv" ]
45+
; bytecomp_c_compiler =
46+
[ "gcc"
47+
; "-O2"
48+
; "-fno-strict-aliasing"
49+
; "-fwrapv"
50+
; "-fPIC"
51+
; "-D_FILE_OFFSET_BITS=64"
52+
; "-D_REENTRANT"
53+
]
54+
; bytecomp_c_libraries = [ "-lm"; "-ldl"; "-lpthread" ]
55+
; native_c_compiler =
56+
[ "gcc"
57+
; "-O2"
58+
; "-fno-strict-aliasing"
59+
; "-fwrapv"
60+
; "-D_FILE_OFFSET_BITS=64"
61+
; "-D_REENTRANT"
62+
]
63+
; native_c_libraries = [ "-lm"; "-ldl" ]
64+
; cc_profile = [ "-pg" ]
65+
; architecture = "amd64"
66+
; model = "default"
67+
; int_size = 63
68+
; word_size = 64
69+
; system = "linux"
70+
; asm = [ "as" ]
71+
; asm_cfi_supported = true
72+
; with_frame_pointers = false
73+
; ext_exe = ""
74+
; ext_obj = ".o"
75+
; ext_asm = ".s"
76+
; ext_lib = ".a"
77+
; ext_dll = ".so"
78+
; os_type = "Unix"
79+
; default_executable_name = "a.out"
80+
; systhread_supported = true
81+
; host = "x86_64-unknown-linux-gnu"
82+
; target = "x86_64-unknown-linux-gnu"
83+
; profiling = true
84+
; flambda = false
85+
; spacetime = false
86+
; safe_string = false
87+
; exec_magic_number = "Caml1999X023"
88+
; cmi_magic_number = "Caml1999I024"
89+
; cmo_magic_number = "Caml1999O023"
90+
; cma_magic_number = "Caml1999A023"
91+
; cmx_magic_number = "Caml1999Y023"
92+
; cmxa_magic_number = "Caml1999Z023"
93+
; ast_impl_magic_number = "Caml1999M023"
94+
; ast_intf_magic_number = "Caml1999N023"
95+
; cmxs_magic_number = "Caml1999D023"
96+
; cmt_magic_number = "Caml1999T024"
97+
; natdynlink_supported = true
98+
; supports_shared_libraries = true
99+
; windows_unicode = false
100+
}
101+
}
102+
Actual targets:
103+
- recursive alias @doc

sphinx/license.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Copyright and License
44

55
Copyright (c) 2020 OCamlPro SAS & Origin Labs SAS
66

7-
87
This software is distributed under the terms of the
98
GNU Lesser General Public License (LGPL) version 2.1 (included below).
109

0 commit comments

Comments
 (0)