This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
|
|
@ -0,0 +1,9 @@
|
|||
(library
|
||||
(name privatelib)
|
||||
(modules privatelib))
|
||||
|
||||
(executable
|
||||
(name publicbin)
|
||||
(modules publicbin)
|
||||
(public_name publicbin)
|
||||
(package publicbin))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
However, public binaries may accept private dependencies
|
||||
$ dune exec ./publicbin.exe
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
(library
|
||||
(name privatelib)
|
||||
(modules privatelib))
|
||||
|
||||
(library
|
||||
(name publiclib)
|
||||
(public_name publiclib)
|
||||
(modules publiclib)
|
||||
(libraries privatelib)
|
||||
(optional))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Private dependencies shouldn't make the library optional
|
||||
$ dune build @install
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
(library
|
||||
(name privatelib)
|
||||
(modules privatelib))
|
||||
|
||||
(library
|
||||
(name publiclib)
|
||||
(public_name publiclib)
|
||||
(libraries privatelib)
|
||||
(modules publiclib))
|
||||
|
|
@ -0,0 +1 @@
|
|||
(lang dune 1.0)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
public libraries may not have private dependencies
|
||||
|
||||
$ dune build
|
||||
File "dune", line 8, characters 12-22:
|
||||
8 | (libraries privatelib)
|
||||
^^^^^^^^^^
|
||||
Error: Library "privatelib" is private, it cannot be a dependency of a public
|
||||
library. You need to give "privatelib" a public name.
|
||||
[1]
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
(library
|
||||
(name ppx_internal)
|
||||
(modules :standard \ mylib)
|
||||
(kind ppx_rewriter)
|
||||
(libraries ppxlib))
|
||||
|
||||
(library
|
||||
(name mylib)
|
||||
(public_name mylib)
|
||||
(preprocess
|
||||
(pps ppx_internal))
|
||||
(modules mylib))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(lang dune 1.9)
|
||||
(name mylib)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
On the other hand, public libraries may have private preprocessors
|
||||
$ dune build mylib.cma
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
(library
|
||||
(name private_runtime_dep)
|
||||
(modules private_runtime_dep))
|
||||
|
||||
(library
|
||||
(name private_ppx)
|
||||
(kind ppx_rewriter)
|
||||
(ppx_runtime_libraries private_runtime_dep)
|
||||
(modules :standard \ mylib private_runtime_dep)
|
||||
(libraries ppxlib))
|
||||
|
||||
(library
|
||||
(name mylib)
|
||||
(public_name mylib)
|
||||
(preprocess
|
||||
(pps private_ppx))
|
||||
(modules mylib))
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
(lang dune 1.9)
|
||||
(name mylib)
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
Unless they introduce private runtime dependencies:
|
||||
$ dune build
|
||||
File "dune", line 16, characters 7-18:
|
||||
16 | (pps private_ppx))
|
||||
^^^^^^^^^^^
|
||||
Error: Library "private_runtime_dep" is private, it cannot be a dependency of
|
||||
a public library. You need to give "private_runtime_dep" a public name.
|
||||
[1]
|
||||
Loading…
Add table
Add a link
Reference in a new issue